Content addressable memory with simultaneous write and compare function

ABSTRACT

A content addressable memory (CAM) device having a simultaneous write and compare function. The CAM device includes a plurality of rows of CAM cells, and match lines and word lines coupled to the rows of CAM cells. The CAM device further includes a plurality of switching circuits coupled to the word lines and the match lines, each switching circuit being adapted to selectively disable assertion of a match signal on a corresponding one of the match lines based, at least in part, on the state of a corresponding one of the word lines.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation-in-part of U.S. patent applicationSer. No. 09/954,827, filed Sep. 18, 2001, now U.S. Pat. No. 6,597,595,which is a continuation-in-part of U.S. patent application Ser. No.09/922,423, filed Aug. 3, 2001.

FIELD OF THE INVENTION

The present invention relates generally to content addressable memorydevices, and more particularly to error detection within contentaddressable memory devices.

BACKGROUND

Content addressable memory (CAM) devices are often used in networkswitching and routing applications to determine forwarding destinationsfor data packets. A CAM device can be instructed to compare a selectedportion of an incoming packet, typically a destination field within thepacket header, with data values, called CAM words, stored in anassociative storage array within the CAM device. If the destinationfield matches a CAM word, the CAM device records a CAM index thatidentifies the location of the matching CAM word within the storagearray, and asserts a match flag to signal the match. The CAM index isthen typically used to index another storage array, either within orseparate from the CAM device, to retrieve a destination address or otherrouting information for the packet.

Any corruption of CAM words stored within a CAM device (e.g., due toalpha particle bombardment or failure of a storage cell within the CAMdevice) may result in a false match/non-match determination andultimately in non-delivery of packets or delivery of packets to anincorrect destination. While it is known to store parity information inthe CAM device for error detection purposes, the parity information isgenerally used to detect errors only when a host device instructs theCAM device to perform a read operation (i.e., output a CAM word). Thatis, parity checking is not performed during a typical compare operationbecause the CAM word is usually not read during such an operation.Moreover, any interruption of the normal operation of the CAM device,for example to read CAM words for error detection purposes, reduces thenumber of timing cycles available for compare operations, effectivelylowering the compare bandwidth of the CAM device.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example, and not by wayof limitation, in the figures of the accompanying drawings and in whichlike reference numerals refer to similar elements and in which:

FIG. 1 illustrates a CAM device according to an embodiment of thepresent invention;

FIG. 2 illustrates an embodiment of the address circuit of FIG. 1 ingreater detail;

FIG. 3 illustrates a configuration register that may be included withinthe CAM device of FIG. 1;

FIG. 4 illustrates a clock circuit that may be used within the CAMdevice of FIG. 1;

FIG. 5 illustrates the structure of the CAM array of FIG. 1 in greaterdetail;

FIG. 6 is a block diagram of an error detector according to a paritychecking embodiment;

FIG. 7 illustrates an alternative embodiment of an error detector;

FIG. 8 illustrates a read/write circuit that includes parity generationcircuitry;

FIG. 9 illustrates the operation of an instruction decoder according toone embodiment;

FIG. 10 illustrates the CAM array, read/write circuit and error detectorof a CAM device having multiple, configurable storage blocks;

FIG. 11 illustrates an alternate error detector for use with a CAMdevice having multiple storage blocks;

FIG. 12 illustrates the structure of an exemplary configurable storageblock that may be used within the CAM array of FIG. 10;

FIG. 13 illustrates a circuit for generating a block parity errorsignal;

FIG. 14 is a block diagram of a CAM device capable of automaticallyinvalidating a CAM word upon detection of a parity error;

FIG. 15 illustrates an error detector that includes a multiple-entryerror address register to support self-invalidation;

FIG. 16 illustrates an alternative error detector 501 that operates onan error correction code instead of a parity bit;

FIG. 17 illustrates the operation of an instruction decoder in aself-invalidation operation;

FIG. 18 illustrates the operation of an instruction decoder in aself-correction operation;

FIG. 19 illustrates the increment operation within an address generatorused to generate a sequence of error check addresses;

FIG. 20 illustrates a system device 651 that includes a host processorand CAM device according to an embodiment of the invention;

FIG. 21 illustrates the operation of the host processor of FIG. 20according to one embodiment;

FIG. 22 illustrates a synchronous storage element which set by assertionof a parity error signal;

FIG. 23 illustrates use of the CAM device of FIG. 1 in an exemplarynetwork switching or routing application;

FIG. 24 illustrates a match error detector that may be included withinthe CAM device of FIG. 1 to generate a match error signal;

FIG. 25 illustrates a CAM device according to an embodiment thatincludes an error CAM to assert a match error signal if a match indexmatches any of a plurality of error addresses;

FIG. 26 illustrates an alternate embodiment of a CAM device thatincludes an error CAM;

FIG. 27 illustrates an embodiment of the error CAM of FIG. 25 in greaterdetail;

FIG. 28 illustrates the queue control circuit of FIG. 27 according toone embodiment;

FIG. 29 illustrates an embodiment of the flag logic circuit of FIG. 28;

FIG. 30 illustrates the CAM cell of FIG. 27 according to one embodiment;

FIG. 31 illustrates an embodiment of the multi-ported CAM cell 801 ofFIG. 30 in greater detail;;

FIG. 32 illustrates a match disable transistor that may be coupled toeach match line within the error CAM array of FIG. 27 to prevent a matchsignal from being asserted on the match line while the corresponding rowof CAM cells is being loaded with an error address value;

FIG. 33 illustrates an alternative CAM row structure for enablingsimultaneous write and compare operations within a CAM array;

FIG. 34 illustrates an alternative circuit arrangement for forcing amismatch indication during a write to a row of CAM cells;

FIG. 35 illustrates another circuit arrangement for forcing a mismatchindication during a write to a row of CAM cells;

FIG. 36 illustrates an exemplary transistor circuit that may be usedwithin the CAM row structure of FIG. 33;

FIG. 37 illustrates another alternative CAM row structure 951 forenabling simultaneous write and compare operations within a CAM array;

FIG. 38 illustrates a system including a CAM device having asimultaneous write and compare function;

FIG. 39 illustrates an embodiment of a CAM device having an access pathinterface to receive data and SRAM-type access control signals;

FIG. 40 illustrates the use of a delay circuit to synchronize the outputof a match index and a match error signal; and

FIG. 41 is a timing diagram that illustrates the pipelining of data anderror compare operations.

DETAILED DESCRIPTION CAM Device

FIG. 1 illustrates a CAM device 100 according to an embodiment of thepresent invention. The CAM device includes a CAM array 101, addresscircuit 103, instruction decoder 105, error detector 107, flag circuit112, priority encoder 114, comparand register 115 and read/write circuit161. Instructions, addresses and commands are input to the CAM devicevia an instruction bus (IBUS) 145, address bus (ABUS) 141 and comparandbus (CBUS) 143, respectively. Each of the buses is preferably amulti-conductor signal path coupled to at least one host device, such asa general purpose processor, digital signal processor, networkprocessor, application specific integrated circuit (ASIC) or otherinstruction issuing device. Also, in alternative embodiments, one ormore of the buses may be eliminated and the corresponding signalstime-multiplexed onto another of the buses.

The CAM array 101 includes a plurality of CAM cells arranged in rows forstoring CAM words. The CAM array also includes a validity storage 102 tostore validity values. Each validity value corresponds to a respectiverow of CAM cells and indicates whether the row contains a valid CAMword. As discussed below, each validity value may be represented by asingle bit or multiple bits. The CAM array 101 is coupled to (i.e.,connected directly to or through one or more intervening circuits) theaddress circuit 103, priority encoder 114, flag circuit 112, comparandregister 115, and read/write circuit 161. The address circuit 103 isused to select a particular row of the CAM array for read or writeaccess. The read/write circuit 161 is used to sense the output of theselected row during a read operation and to transmit a value to theselected row during a write operation. The comparand register 115 isused to store a comparand value received via the comparand bus 143, andoutputs the comparand value to the CAM array 101. In alternativeembodiments the comparand register 115 may be omitted and the comparandvalue input directly to the CAM array 101 from the comparand bus 143.During a compare operation, the comparand may be masked by a global maskvalue, then compared simultaneously with all the CAM words stored in theCAM array 101. Each of the rows of CAM cells is coupled to acorresponding match line 182, and any match between the comparand and avalid CAM word results in a match signal being output to the priorityencoder 114 and flag circuit 112 via the corresponding match line 182.When one or more match signals are asserted on the match lines 182, thepriority encoder 114 selects one of the match signals and outputs a CAMindex 174 (i.e., address of the CAM word corresponding to the selectedmatch signal). The flag circuit 112 also receives the match signals, andoutputs a match flag signal to indicate that a match has occurred. Ifmore than one match signal is asserted, the flag circuit mayadditionally output a multiple match flag signal to indicate thatmultiple matches have occurred.

As described below in greater detail, the CAM array 101 is preferablystructured to permit read and compare operations to be executedconcurrently (i.e., at least partly overlapping in time). Consequently,the CAM array may be read for error checking purposes even whenhost-requested compare operations are being performed. This providessignificant advantages over the prior art error checking techniquedescribed above because error checking can effectively be performed inthe background, with little or no consumption of compare bandwidth.Moreover, the prior art error checking occurs as part of ahost-requested read, meaning that only those.CAM array locationsselected to be read by the host are error checked. Unless the host isprogrammed to systematically read all the locations in the CAM array, itis likely that numerous CAM array locations will not be checked. Bycontrast, in embodiments of the present invention, error checking isperformed systematically using an address generator within addresscircuit 103 to generate a predetermined sequence of error checkaddresses, thus ensuring that all locations within the CAM array arechecked.

Still referring to FIG. 1, the address circuit 103 is used to access theCAM array during read and write operations. Address values (received,for example, via the address bus 141 or from address sources within theCAM device) are decoded to activate corresponding word lines 181. Eachword line is coupled to a respective row of CAM cells within the CAMarray 101 and enables a CAM word to be output from or input to thearray. The instruction decoder 105 outputs a select signal 118 to selectthe address source used to access the CAM array 101. The instructiondecoder also outputs an enable signal 126 to the address circuit 103.The enable signal 126 is used to control generation of error checkaddresses by a check address generator within the address circuit 103.In one embodiment, the address circuit 103 outputs each check address tothe error detector 107.

All instructions to the CAM device, including instructions to load otherregisters are first received in the instruction decoder 105 via theinstruction bus 145. The instruction decoder 105 includes circuitry todecode the incoming instructions as well as control circuitry thatresponds to the decoded instructions by issuing control and timingsignals to other circuit blocks within the CAM device 100. In oneembodiment, the instruction decoder 105 is a state machine thattransitions from state to state in response to transitions of a clocksignal 104 (CLK) and according to status signals received from othercircuit blocks within the CAM device 100 and instructions received fromthe decode circuit 106. For another embodiment, the instruction decoder105 is a lookup table or read only memory (ROM). The instruction decoder105 may further include delay circuitry to delay output of timing andcontrol signals to other circuit blocks within the CAM device 100 untilappropriate times within a given cycle of the clock signal 104.

The error detector 107 is used to detect errors in CAM words output fromthe CAM array in error checking operations. The error detector 107 iscoupled to receive a CAM word and corresponding validity value from theread/write circuit 161 and to receive the control signals RESET 153 andREAD 151 from the instruction decoder 105. Upon detecting an error, theerror detector 107 outputs an error address 131 and asserts an errorflag signal 132. The error detector 107 receives the check address 155from the address circuit 103 for error logging purposes, and mayoptionally output an error address as indicated by dashed line 131. Inalternate embodiments, the reset signal 153 and/or read signal 151 maybe supplied by an external device (e.g., a host processor) instead ofthe instruction decoder 105.

FIG. 2 illustrates an embodiment of the address circuit 103 of FIG. 1 ingreater detail.

The address circuit 103 includes an address selector 125 that respondsto the select signal 118 from the instruction decoder (i.e., element 105of FIG. 1) by selecting an address 178 from one of a plurality ofaddress sources. An address decoder 127 decodes the selected address 178to activate one of a plurality of word lines 181. The address sourcesinclude one or more of a highest priority match (HPM) register 121, nextfree address (NFA) register 122, address bus 141, and check addressgenerator 124. Additional address sources (not shown) may also beprovided. The highest priority match (HPM) register 121 is loaded (e.g.,under control of the instruction decoder) with a CAM index 174 generatedduring a compare operation and therefore points to the CAM word thatproduced the highest priority match in the most recent compareoperation. The next free address register 122 is loaded with a CAM index174 that points to the address of an empty row of CAM cells within theCAM array (i.e., the “next free address”). In one embodiment, the nextfree address is determined during a write operation based on the stateof the validity values within the CAM array. The check address generator124 is used to generate a sequence of check addresses for error checkingpurposes. In the embodiment of FIG. 1, the check address generatoroutputs one check address at a time and advances to the next checkaddress in the sequence in response to the enable signal 126 from theinstruction decoder.

The check address 155 may alternatively be output from the check addressgenerator 124 or from the address selector 125. When the check addressis output by the address selector 125, any address source, including thecheck address generator, may be used to supply the check address to theerror detector (i.e., element 107 of FIG. 1). For example, ahost-requested read operation may be performed at an address suppliedvia the address bus 141 or at the address indicated by the HPM register121. In either case, error checking may be performed on the CAM wordread out of the CAM array, and the output of the address selector 125used to provide the check address to the error detector.

Although the HPM register 121, NFA register 122 and check addressgenerator 124 are all shown as being part of the address circuit 103,these circuit blocks may alternatively be disposed elsewhere in the CAMdevice. For example, in one embodiment, the HPM register is implementedby a field of bits (i.e., to contain the HPM address) within a statusregister of the CAM device. In such an embodiment, the status registermay be selected by the address selector to provide the HPM address for aCAM array access. Contents of the status register, including the HPMaddress, may also be output from the CAM device in a status readoperation.

Still referring to FIG. 2, the check address generator 124 may be loadedto start error checking from a particular address within the CAM array.Also, the check address generator may be started from a known state, forexample, upon device power-up or in response to a reset operation.

FIG. 3 illustrates a configuration register 109 that may be includedwithin the CAM device of FIG. 1 and used to provide configurationinformation to other circuit blocks within the CAM device. In oneembodiment, the configuration register 109 is loaded, in response to aload signal 175 from the instruction decoder, with one or moreconfiguration values received via the comparand bus 143. One or moreother signal paths may be used to provide configuration information inalternative embodiments. Connections between the configuration register109 and other circuit blocks within the CAM device are discussed belowin connection with descriptions of specific types of configurationinformation.

FIG. 4 illustrates a clock circuit 113 that may be used within the CAMdevice of FIG. 1 to generate the clock signal CLK 104 based on anexternally generated reference clock 147. The clock buffer 113 mayinclude circuitry, such as a phase locked loop or delay locked loop, toincrease or decrease the frequency of CLK 104 relative to the referenceclock 147 and to provide phase offsets as needed to time reception andtransmission of signals on the various buses coupled to the CAM device.For simplicity, FIG. 1 shows CLK 104 being supplied only to theinstruction decoder 105. In actual implementation, CLK 104 and timingsignals derived from CLK 104 may be provided to other circuit blockswithin the CAM device 100.

CAM Array

FIG. 5 illustrates the structure of the CAM array 101 in greater detail.A plurality of CAM cells 201 are arranged in rows and columns, with eachrow of CAM cells 201 being coupled to a respective word line 181 and toa respective match line 182. Each of the word lines 181 is coupled tothe address circuit 103 of FIG. 1, and each of the match lines 182 iscoupled to the priority encoder 114 and the flag circuit 112 of FIG. 1.Each of the CAM cells 201 in a given column is coupled to a pair of bitlines, BL 186 and BLB 187, and to a pair of comparand lines, CL 184 andCLB 185. Each CAM cell 201 preferably includes a memory cell to store atleast one binary bit of data, and a compare circuit to compare thecontent of the memory cell with a comparand signal and its complementpresented on the comparand lines CL 184 and CLB 185. Each CAM cell 201may further include a local mask cell to store a local mask value (sucha CAM cell is referred to as a ternary CAM cell). In one embodiment, thememory cell of each CAM cell 201 is a static storage element implementedby back-to-back coupled inverters. In alternative embodiments, differenttypes of storage cells may be used including, without limitation,dynamic storage elements (typically implemented by a single transistorand charge storage element), non-volatile storage elements or any othertype of storage element that can be used to store digital data. In thecase of a ternary CAM cell, the local mask cell may likewise beimplemented using back-to-back coupled inverters or any of the differenttypes of storage cells mentioned above.

During a compare operation, a respective portion of the comparand isapplied to each column of CAM cells 201 via lines CL/CLB such that thecomplete comparand is applied to each row of the CAM cells 201simultaneously. In one embodiment, each of the match lines 182 isprecharged to a high logical level at the start of a comparisonoperation, but pulled down to a low logical level by the compare circuitwithin any attached CAM cell 201 that receives comparand signals whichdo not match the stored data value. In this configuration, any matchline 182 not pulled low constitutes a match signal. The match lines 182are coupled to the flag circuit 112 of FIG. 1 which determines whetherany match signals are asserted and, if so, asserts the match flag signal176. The flag circuit may also assert a multiple match flag signal ifmore than one match signal is asserted. The match lines 182 are alsocoupled to the priority encoder 114 of FIG. 1 which determines thehighest priority match signal according to a predeterminedprioritization policy and outputs an index (i.e., a CAM index) thatcorresponds to the CAM array location that produced the match signal.

During a read or write access to the CAM array 101, an address of CAMcells to be accessed is supplied to the address decoder 127 of FIG. 2.The address decoder 127 decodes the address to activate the word line181 that corresponds to the selected row of CAM cells. The activatedword line effectively couples the memory cells of the selected row ofCAM cells to the bit lines BL/BLB (e.g., by way of pass gates coupledbetween the memory cells and the bit lines), thereby enabling data to beread out of or written into the selected row. In a write operation, asignal driving circuit (not shown in FIG. 5) within the read/writecircuit 161 of FIG. 1 is enabled by the instruction decoder to drive aCAM word or local mask word onto the bit lines BL/BLB (additional bitlines, not shown in FIG. 5, may alternatively be provided to access thelocal mask cells to store or read a local mask word). The signalspresent on the bit lines are then latched or otherwise stored in thememory cells in the selected row of CAM cells. During a read operation,the contents of the memory cells (or local mask cells) of the selectedrow are enabled onto the bit lines BL/BLB where they are sensed by abank of sense amplifiers 162 within the read/write circuit.

Reflecting on the structure of CAM array 101, it can be seen thatproviding separate signal paths to the CAM cells 201 for comparand anddata values enables data to be output from the CAM array 101concurrently with a comparand being input into the CAM array 101 forcomparison purposes. By this arrangement, a CAM word (or local maskword) may be read from the CAM array for error checking purposesconcurrently with performance of a compare operation. As mentioned, thisconcurrency of comparison and error checking operations providessignificant advantages over the prior art technique described above,including the ability to do systematic background error checking withlittle or no reduction in compare bandwidth.

Still referring to FIG. 5, the CAM array 101 also includes validitystorage cells 202 which form the validity storage discussed above inreference to FIG. 1. In one embodiment, the validity storage cells aresimilar to the CAM cells 201, but include additional circuitry toinitialize the validity values to a predetermined state at devicepower-up. For example, in the case of validity storage cells 202 havingvolatile memory cells, the validity storage cells 202 preferably includecircuitry to force the validity value within each validity storage cell202 to a reset state in response to a reset signal asserted on line 171,thus indicating that none of the rows of CAM cells 201 include valid CAMwords. Thereafter, as CAM words are written to selected rows of CAMcells 201, the validity values within the corresponding validity storagecells 202 are set to indicate storage of valid CAM words.

In one embodiment, each validity value is represented by a single binarybit, called a validity bit. In a first state (i.e., when set), thevalidity bit indicates that the corresponding row of CAM cells containsa valid CAM word. Conversely, in a second state (i.e., when reset), thevalidity bit indicates that the corresponding row of CAM cells does notcontain a valid CAM word. In alternative embodiments, two or more bitsmay be used to represent the validity value. For example, in onealternative embodiment, the validity value is formed by a pair of bits:a skip bit and an empty bit. The skip bit indicates that thecorresponding row of CAM cells are to be skipped (i.e., ignored) duringa compare operation, while the empty bit indicates that no CAM word isstored in the corresponding row of CAM cells. Thus, the skip bit and theempty bit are each reset to indicate that a valid CAM word is stored inthe corresponding row of CAM cells. In the interest of clarity, thevalidity value is described as a validity bit in the remainder of thepresent description. However, any number of bits may be used to form thevalidity value in alternative embodiments.

During a compare operation, the validity bits are used to prevent matchsignal assertion for those rows of CAM cells which do not contain validCAM words. For example, in the embodiment described above in which thematch line is pulled low to signal a mismatch, each reset validity bitprevents assertion of a match signal by pulling the match line low forthe corresponding row of CAM cells. Consequently, no match is signaledfor rows having reset validity bits regardless of whether the rowcontents match the comparand. During a read operation, the validity bitis sensed (i.e., via lines 193 and 194) along with the CAM word andforwarded to the error detector 107 where it is used to preventassertion of the error signal 132 and logging of an error address 131for invalid CAM words.

Error Detector

FIG. 6 is a block diagram of the error detector 107 of FIG. 1 accordingto a parity checking embodiment. As shown, a CAM word formed by of Ngroups of M data bits is output from the sense amplifier bank 162. Thefirst group of data bits is designated D[M−1, 0], the second group ofdata bits is designated D[(2×M)−1, M] and so forth to the final group ofdata bits designated D[(N×M)−1, (N−1)×M]. The CAM word also includes Nparity bits, one for each group of M bits. Although N parity bits aredepicted in FIG. 6, any number of parity bits per CAM word may be usedin alternative embodiments. For example, a single parity bit may be usedfor the entire CAM word.

The data and parity bits are input to a parity check circuit 201 thatincludes a separate parity generator 206 and compare circuit 208 foreach group of data bits and its corresponding parity bit. Each paritygenerator 206 generates a binary output according to the state of aneven/odd select signal 232 and the number of set (or reset) data bitswithin the corresponding group of data bits. For example if the even/oddselect signal 232 selects odd parity, circuitry within the paritygenerator 206 will output a logic ‘1’ if the input group of data bitscontains an odd number of logic ‘1’ data bits, and a logic ‘0’ if thegroup of data bits contains an even number of logic ‘1’ data bits. Ifthe even/odd select signal 232 selects even parity, the output of theparity generator 206 is inverted, i.e., outputting ‘1’ if the inputgroup of data bits contains an even number of logic ‘1’ data bits and alogic ‘0’ if the group of data bits contains an odd number of logic ‘1’data bits. In alternative embodiments, the logic states may be invertedso that the parity generator 206 outputs a logic ‘0’ if the number oflogic ‘0’ data bits is odd or even (in the case of odd parity selectionor even parity selection, respectively). Also, the output of the paritygenerator 206 may be inverted so that, if odd or even parity isselected, the total number of bits in the logic ‘1’ state, including thebit output by the parity generator, is always odd or even, respectively.

The parity generator 206 is preferably formed using conventionalcombinatorial circuitry, for example a combination of exclusive ORgates, to produce a parity result shortly after a CAM word is loadedinto the row buffer 162. The even/odd select signal 232 may be outputfrom a configuration register (e.g., element 109 of FIG. 3) according toa configuration value programmed by the host processor. In oneembodiment, the parity bits stored in the CAM array are generated bycircuitry external to the CAM device (e.g., the host processor), thenwritten to the CAM array along with the corresponding CAM word.Accordingly, such parity bits may be selected to produce either odd oreven parity according to the configuration of the external parity bitgenerator. In that case the even/odd select signal 232 may be programmedby the host to match the parity configuration of the external parity bitgenerator. In an alternative embodiment, shown in FIG. 8, paritygeneration circuitry 306 within the read/write circuit 161 (element 161of FIG. 1) may be coupled to the write data path 302 and used togenerate one or more parity bits. The write data and correspondingparity bits are then written into the CAM array by driver circuit 307during a CAM write operation. The even/odd select signal 232 may beinput to the parity generation circuitry 306 or, alternatively, theeven/odd select signal 232 may be omitted altogether (i.e., omitted fromread/write circuit 161 and error detector 107 of FIG. 6) and theeven/odd selection may be hardwired for either even or odd paritygeneration. In alternative embodiments, parity functions other than evenand odd parity may be used.

Returning to FIG. 6, the compare circuit 208 compares the output of theparity generator 206 with the corresponding stored parity bit. Comparecircuit 208 is preferably a combinatorial logic circuit such as an XORcircuit that outputs a logic ‘1’ only if the stored parity bit. and theparity bit generated by the parity generator 206 do not match, but mayalternatively be any type of circuit for detecting mismatch between thestored and generated parity bits. The outputs of all the comparecircuits 208 are logically ORed in gate 221 so that, if any one of thecompare circuits 208 signals a mismatch (i.e., a logical ‘1’), theparity check circuit 201 will output a logical, ‘1’. For embodiments inwhich a single parity bit is used for an entire CAM word, OR gate 221may be omitted. As shown in FIG. 6, the output of the parity checkcircuit 201 is gated by the validity bit for the CAM word in AND gate222 to generate a parity error signal 231. That is, even if a paritymismatch is signaled by the parity check circuit 201, the parity errorsignal 231 will not be asserted by AND gate 222 unless the validity bitfor the CAM word being error checked indicates that the CAM word isvalid. By this arrangement, parity errors are signaled only for validCAM words.

The parity error signal 231 is supplied to the set input of an S-Rflip-flop and to the load input of an error address register 203. Thecheck address 155 from the check address generator (element 124 of FIG.2), which constitutes a parity address in this example, is also input tothe error address register 203 so that, if the parity error signal 231is asserted, the parity address is loaded into the error addressregister 203. As shown in FIG. 6, CLK 104 is input to the error addressregister 203 to initiate the load operation, but another timing signalmay be used to initiate the load operation in an alternative embodiment.As described below, the error address register 203 may be designed tostore only a single error address (i.e., address of a location withinthe CAM array that produced a parity error), or the error addressregister 203 may be designed to store multiple error address entries. Ineither case, one entry within the error address register is preferablyused to produce the error address signal 131. In the case of amultiple-entry error address register, the read signal 151 may be usedto advance the entries in the error address register 203. In the case ofa single-entry error address register, the read signal may be omitted.

Still referring to FIG. 6, the S-R flip-flop 224, when set, drives theerror flag signal 132. As described above, the error flag signal 132 ispreferably output directly to a host device to signal the errorcondition, but may alternatively (or additionally) be output as part ofa status word during a host-requested status read operation. The resetsignal 153 is received from the instruction decoder as shown in FIG. 1and is used to clear the error flag signal by resetting the S-Rflip-flop 224.

In alternative embodiments, storage elements other than an S-R flip-flopmay be used to register the error condition. For example, FIG. 22illustrates a synchronous storage element 261 which is set by assertionof the parity error signal 231 during a CLK transition. The output ofthe synchronous storage element 261, i.e., the error flag signal 132, islogically ORed with the parity error signal 231 in gate 258 so that theerror flag signal 132 remains asserted after the parity error signal 231is deasserted. In one embodiment, the output of the OR gate 258 is ANDedwith an active low version of the reset signal 154 in gate 260 beforereaching the input of the synchronous storage element. By thisarrangement, the error flag signal 132 is reset at any CLK transition inwhich the active low reset signal 154 is asserted. In an alternativeembodiment, the AND gate 260 may be omitted and the reset signal 153applied to a dedicated reset input of the synchronous storage element261. This alternative embodiment is depicted by the dashed arrow 255.

FIG. 7 illustrates an alternative embodiment of an error detector 287 inwhich a multiple-entry error address register 289 is provided and inwhich a separate error flag value (E₀−E_(x−1)) is stored along with eacherror address in the error address register. The multiple-entry erroraddress register 289 preferably operates as a first-in-first-out (FIFO)storage having head and tail entries. The error flag value for the headentry in the FIFO (i.e., E₀) is used to produce the error flag signal132 and the error address value stored in the head entry (i.e., EADDR₀)is used to drive the error address signal 131. Accordingly, if the headentry in the FIFO contains an error entry (i.e., error flag value E₀ isset), the error flag signal 132 will be asserted and the address of theCAM word containing the error will be present on the error addressoutput 131. Conversely, if the head entry in the FIFO does not containan error entry (E₀ is not set), the error flag signal 132 will not beasserted.

Still referring to FIG. 7, the parity check circuit 201 and logic gate222 function as described in reference to FIG. 6 to generate a parityerror signal 231 if the CAM word under test contains an error and isindicated to be valid by the corresponding validity bit. As shown, theparity error signal 231 is used to signal the error address register 289to load the check address 155 into a register entry and to set the errorflag for the entry. The error address register load operation may betimed by the CLK signal 104 as shown, or by another timing signal.

The read signal 151 is asserted during an error address read operationto advance the contents of the error address register 289. Morespecifically, when the read signal 151 is asserted, the contents of theerror address register 289 are shifted forward so that the entrydepicted in FIG. 7 as EADDR₁/E₁ becomes the head entry EADD₀/E₀, entryEADDR₂/E₂ becomes EADDR₁/E₁ and so forth. This entry shifting may beaccomplished either by actual shifting of contents from one entry to thenext or by shifting of pointers that indicate the head and tail entrieswithin the error address register 289. In the content shiftingembodiment, the error flag value for the former tail entry is clearedwhen the shift is complete to indicate that the entry is free to receivea new error address. In the case of pointer shifting, the error flagvalue for the former head entry is cleared to indicate that the entrydoes not contain a valid error address.

The error address register 289 is depicted as having X entries (0 toX−1) available for error address storage. If all X entries of the erroraddress register are filled with valid error addresses, a full signal,EA FULL 291, may be asserted to indicate the full condition. The fullsignal 291 is preferably provided to the instruction decoder (element105 of FIG. 1) to stall further error checking until one or more erroraddress read operations are performed to free entries in the erroraddress register 289. The full signal 291 may also be output from theCAM device (e.g., directly or in response to a status read) to signalthe full condition to the host processor or other entities external tothe CAM device.

Instruction Decoder Operation—Concurrent Instruction Execution andParity Check

FIG. 9 illustrates the operation of an instruction decoder (e.g.,element 105 of FIG. 1) to control background error checking according toone embodiment. Initially, in block 309, the instruction decoder selectsthe check address generator to be the address source for a read accessto the CAM array. At block 310, the instruction decoder starts an errorcheck timer. In one embodiment, the timer is a counter that counts up ordown from an initial value (the reset value) until a predeterminedterminal count value is reached, the difference between the initialvalue and the terminal count corresponding to the time required tocomplete an error checking operation on the CAM array. During the errorcheck operation, the instruction decoder monitors incoming instructionsin decision block 311 to determine whether a host processor hasrequested read or write access to the CAM array. If so, the instructiondecoder resets the error check timer in to the initial value in block312, then issues the appropriate signals to perform the host requestedaccess in block 313. A predetermined time later (according to the amountof time required to complete the host requested operation), theinstruction decoder restarts the error check operation at block 309.

The instruction decoder continues to monitor incoming instructions indecision block 311 until the error check timer has reached the terminalcount value (as determined at decision block 314). After the error checktimer has reached the terminal count, the instruction decoder signalsthe check address generator to increment the check address (block 315)and resets the error check timer at block 316, before beginning anothererror check operation at block 310.

In an alternative embodiment, the error flag signal is provided to theinstruction decoder, which selectively enables the check addressgenerator to increment the check address according to whether a parityerror is detected. Accordingly, if the error flag signal is determinedto be set after decision block 314, the error check operation iscompleted without signaling the check address generator to increment thecheck address and further error checking is halted until remedial actionis taken (e.g., self-invalidation or self-correction, discussed below,or action by the host). Alternatively, if the error detector includes amultiple-entry error address register, the instruction decoder maysignal the check address generator to increment the check addressdespite error flag signal assertion so long as the error addressregister is not full. In such an embodiment, a full signal may be outputby the error address register to notify the instruction decoder when theerror address register is full (i.e., when all entries of the erroraddress register have been loaded with error addresses).

In the embodiment illustrated by FIG. 9, the instruction decoder doesnot disable the check address generator from incrementing the checkaddress except in response to a host instruction. The host processormay, for example, detect assertion of the error flag signal and issue aninstruction to the CAM device to halt further testing until the hostprocessor takes remedial action (e.g., restores a valid CAM word to theCAM array location indicated by the error address).

As mentioned above in reference to FIG. 2, error checking may beperformed not only on CAM words selected by the check address generator,but on any CAM word read from the CAM array. For example, performing thehost requested access in block 313 may involve reading a CAM word fromthe array at a host-supplied address (or other address source such asthe HPM register), then error checking the CAM word in the mannerdescribed above. As discussed in reference to FIG. 2, the check addressmay be selected by the address selector 125 so that a proper checkaddress may be stored by the error detector regardless of the addresssource.

Configurable Multi-Block CAM Device

FIG. 10 illustrates the CAM array 321, read/write circuit 322 and errordetector 323 of a CAM device having multiple, configurable storageblocks 325. In the embodiment of FIG. 10, each of the storage blocks325, designated 1 through K, is coupled to the read/write circuit 322and has a storage width and depth according to a configuration signal,CONFIG 327. In alternative embodiments, the storage width and depth ofone or more (or all) of the storage blocks may be fixed and theconfiguration signal 327 omitted.

Sense amplifier circuitry within the read/write circuit 322 is used tosense a CAM word output from the CAM array 321 during an error checkoperation as described in reference to FIG. 5. As described below, errorcheck operations may be performed on each of the storage blocks 325 insequence or concurrently on all the storage blocks 325. In either case,the data, parity and validity values (referred to collectively as a“DPV” value) for the output CAM word is forwarded to an error detectioncircuit 329 that corresponds to the block containing the CAM word. Eachof the error detection circuits, in turn, outputs a parity error signalfor its respective block, referred to as a block parity error signal330. The block parity error signals 330 from the error detectioncircuits 329 are logically ORed in gate 331 to produce a global parityerror signal 335. The global parity error signal 335 is coupled to theload input of the error address register 337 and the set input of theS-R flip flop 339. Accordingly, when a parity error is signaled by anyof the error detection circuits 329, the resulting global parity errorsignal is used to load the check address 155 (e.g., from the checkaddress generator) into the error address register 337 and is used toset S-R flip-flop 339. The error address register 337 and S-R flip flop339 output the error address 131 and error flag signal 132,respectively, and respond to the read signal 151, CLK 104 and resetsignal 153 as described above in reference to FIGS. 3 and 4. Asdiscussed, other circuits may be used to register or latch the errorflag signal. Also, the error address register may be a single ormulti-entry register and may be implemented according to any of thedifferent embodiments described in reference to FIGS. 3 and 4.

For embodiments that concurrently perform error checking on CAM wordsfrom each of the different storage blocks, error detector 323 mayinclude additional circuitry (not shown) to store a value indicative ofwhich of the error detection circuits 329 has signaled a block error330. This value, referred to as a block identifier, is preferably storedalong with the check address 155 within the error address register 337.The block identifier may then be output from the error address register337 as part of the error address to enable a host or other circuitrywithin the CAM device to identify the block or blocks within the CAMarray 327 that produced the error indication.

Although error detector 323 may be used to simultaneously error check arespective CAM word from each of the blocks, the provision of separateerror detection circuits for each storage block increases the transistorcount and complexity of the error detector implementation. Inembodiments of the multiple storage block CAM device that error checkone CAM word at a time, the multiple error detection circuits 329 may beomitted in favor of a single error detection circuit that is selectivelycoupled to the output of each of the storage blocks 325. An errordetector 348 having such an alternative arrangement is illustrated inFIG. 11. The DPV values from each of the K storage blocks are coupled torespective inputs of a multiplexer 349. Block address bits from within(or derived from) the check address 155 are supplied to a select inputof the multiplexer 349 to select the DPV value from the storage blockbeing error checked. The error detection circuit 350 then generates aerror signal 357 in the manner described above, the error signal 357being used to set the error flag signal 132 (i.e., in S-R flip flop 352or other storage circuit) and also to signal the error address register354 to load the check address 155 at the next CLK 104 transition. Theread and reset signals (151, 153) operate as described above to advancethe entries within the error address register and reset the error flagsignal, respectively. Also, the error address register 354 may be asingle or multi-entry register and may be implemented according to anyof the different embodiments described above.

Configurable Storage Block

FIG. 12 illustrates the structure of an exemplary configurable storageblock 381 that may be used within the CAM array of FIG. 10. As shown,the storage block 381 is organized in four segments (0 to 3, althoughmore or fewer segments may be used) with each segment including N rowsof CAM cells (0 to N−1), a parity value and a valid value. As with theCAM cells in embodiments described above, each CAM cell may have anytype of storage cell, and may be a ternary CAM cell. The contents of theCAM cells are designated “DATA” in FIG. 12 and may include CAM words andlocal mask words.

A configuration signal (not shown), for example from configurationregister 109 of FIG. 3, is used to determine how the segments areaccessed in a host requested read or write operations and, therefore,how CAM words (and local mask values) are stored in the storage block381. For example, in a first configuration, each segment is used tostore N distinct 72-bit CAM words so that the storage dimension of thestorage block 381 is 4N×72 bits. This configuration is referred to as a“by one” configuration (x1) to indicate that the CAM word is one segmentwide. In a x2 configuration, each pair of segments (i.e., segment pair0, 1 and segment pair 2,3) is used to store 144-bit CAM words so thatthe storage block 381 has a storage dimension of 2N×144 bits. In x4configuration, all four segments are used to store 288-bit CAM words sothat the storage block 381 has a storage dimension of N×288 bits. Itwill be appreciated that more or fewer than 72 bits per segment may beprovided in alternative embodiments and that numerous otherconfigurations may be achieved in storage blocks having additionalsegments or different distributions of validity values within thestorage block. Also, while a single parity bit per segment is shown inFIG. 12, any number of parity bits may be provided per segment inalternative embodiments (e.g., as shown in FIG. 6).

In the embodiment of FIG. 12, parity checking is performed one segmentafter another for each segment within the storage block 381, regardlessof storage dimension configuration. In such an embodiment, the checkaddress generator 383 preferably generates a check address having threecomponents: a block address component 391 to select the storage block tobe parity checked, a segment address component 393 to select the segmentto be parity checked within the selected storage block, and a rowaddress component 395 to select a row within the selected segment of theselected bock (note that the check address may be a single value, withthe block, segment and row address components being represented byselected bits within the check address). The segment address component393 of the check address is input to the multiplexer 382 to select theappropriate DPV value from the storage block 381. The data and parityvalues are supplied to a parity check circuit 396 to determine whetherthere is a parity mismatch. The output of the parity check circuit 396is gated by the validity bit in AND gate 398 to produce a block parityerror signal 401. The block parity error signal 401 may then belogically ORed with block parity error signals from other blocks toproduce a global parity error signal as shown in FIG. 10. Also, thoughnot shown in FIG. 12, the multiplexer 382 may be extended (or a secondmultiplexer provided) to allow selection of a DPV value from a selectedsegment (indicated by the segment address component of the parityaddress) from a selected block (indicated by the block address componentof the parity address) for input to a single error detection circuit asshown in FIG. 11.

FIG. 13 illustrates a circuit for generating a block parity error signal427 through concurrent parity checking of complete CAM words regardlessof whether the storage block 381 is configured to store a x1, x2 or x4CAM word. As shown, four distinct parity check circuits 405 are coupledrespectively to receive the data and parity values from the foursegments of the storage block 381 (more or fewer parity check circuits405 may be provided according to the number of storage block segments).The output of each parity check circuit is ANDed in a respective logicgate 407 with the validity bit from the corresponding segment to producea segment parity error signal 409. The four segment parity error signals409 are input individually and in logical combinations with one anotherto multiplexer 421 The logical combinations include: (1) ORing thesegment 3 parity error signal with the segment 2 parity error signal inOR gate 411 to produce a x2 parity error signal indicative of whether ax2 CAM word spanning segments 2 and 3 has a parity error; 2) ORing thesegment 1 parity error signal with the segment 0 parity error signal inOR gate 412 to produce a x2 parity error signal indicative of whether ax2 CAM word spanning segments 0 and 1 has a parity error; and 3) ORingall the segment parity error signals in OR gate 413 to produce a x4parity error signal indicative of whether a CAM word spanning all foursegments has a parity error. Additional combinations of segment parityerror signals 409 may be provided in alternative embodiments.

Still referring to FIG. 13, the multiplexer 427 is responsive to aconfiguration signal 423 (e.g., from the configuration register 109 ofFIG. 3), and a segment address 425 (e.g., from the check addressgenerator) to select one of the individual segment parity error signals409 or one of the logical combinations of segment parity error signals(i.e., x2 or x4 parity error signals) to drive the block parity errorsignal 427. For example, if the configuration signal 423 indicates a x1configuration, then the segment address 425 is used to select one of thefour segment parity error signals 409 to drive the block parity errorsignal 427. If the configuration signal 423 indicates a x2configuration, then the segment address 425 is used to select betweenthe two x2 parity error signals output from OR gates 411 and 412 todrive the block parity error signal 427. If the configuration signal 423indicates a x4 configuration, the x4 parity error signal output from ORgate 413 is selected to drive the block parity error signal 427.

The circuit of FIG. 13 may be modified such that, for the x2 and x4parity error signals, the outputs of the participating parity checkcircuits 405 are first logically ORed with one another and then ANDedwith a logical OR combination of corresponding validity bits. By thisarrangement, only one of the two validity bits for a x2 CAM word needsto be set to perform a complete parity check of the CAM word. A similarlogical OR combination of all four parity check circuit outputs may beANDed with a logical OR combination of all four validity bits to producethe x4 parity error signal. The Boolean expressions for such anarrangement are as follows:

x 2 (S 0+S 1)=(PCC 0+PCC 1)*(V 0+V 1)

x 2 (S 2+S 3)=(PCC 2+PCC 3)*(V 2+V 3)

x 4=(PCC 0+PCC 1+PCC 2+PCC 3)*(V 0+V 1+V 2+V 3),

where the ‘+’ symbol represents a logical OR operation, the ‘*’ symbolrepresents a logical AND operation, V signifies a validity bit and PCCsignifies a parity check circuit output.

The circuit of FIG. 13 may alternatively be modified to require that allthe validity bits for a given x2 or x4 CAM word be set in order for anerror to be signaled. The Boolean expressions for such an arrangementare as follows:

x 2(S 0+S 1)=(PCC 0+PCC 1)*V 0*V 1

x 2(S 2+S 3)=(PCC 2+PCC 3)*V 2*V 3

 x 4=(PCC 0+PCC 1+PCC 2+PCC 3)*V 0*V 1*V 2*V 3

Other logical constructs for generating x2 and x4 parity error signalsmay be used without departing from the scope of the present invention.Also, numerous additional logical constructs may be used to generatemulti-segment parity error signals for a storage block having additionalsegments or different distributions of validity bits within the storageblock.

Still referring to FIG. 13, in an alternative embodiment a row of CAMcells spanning all four segments of the CAM block 381 may beconcurrently error checked without regard to the width and depthconfiguration of the block. In such an embodiment, the multiplexer 421and logic gates 411 and 412 may be omitted, and the OR gate 413 used togenerate the block parity error.

CAM Device with Self-Invalidating Function

FIG. 14 is a block diagram of a CAM device 441 capable of automaticallyinvalidating a CAM word upon detection of an error. The CAM device 441,referred to as a self-invalidating CAM, includes an instruction decoder443, check address generator 445, address selector 447, address decoder449, CAM array 450, read write circuit 453 and error detector 455.Numerous other circuit blocks may be included in the CAM device 441,including circuit blocks shown in the CAM device of FIG. 1, but havebeen omitted from FIG. 14 in the interest of clarity. The instructiondecoder 443, check address generator 445, address selector 447, addressdecoder 449, CAM array 450, read/write circuit 453 and error detector455 operate generally in the manner described in reference to thepreceding figures (e.g., instruction decoder 105 of FIG. 1; checkaddress generator 124 of FIG. 2; address selector 125 of FIG. 2; addressdecoder 127 of FIG. 2; CAM array 101 of FIGS. 1 and 5; read/writecircuit 161 of FIGS. 1 and 8, and read/write circuit 322 of FIG. 10; anderror detector 107 of FIGS. 1, 5, and 6, error detector 287 of FIG. 7,error detector 323 of FIG. 10, and error detector 348 of FIG. 11). Morespecifically, if the error detection circuit 456 detects a parity errorin the CAM word selected for error checking by the check addressgenerator 445, the error flag signal 132 is asserted (e.g., by S-R flipflop 457 or other storage element) and the error address register 458 isloaded with the check address 155. The entries within the error addressregister 458 are advanced in response to a read signal 151 from theinstruction decoder 443 and the error flag signal is deasserted. inresponse to a reset signal 153 from the instruction decoder 443.

As shown, the instruction decoder 443 is coupled to the output of theS-R flip flop 457 and therefore is signaled upon detection of a parityerror. If no parity error is signaled, the instruction decoder 443issues an increment signal 444 to the check address generator 445 whichresponds by incrementing a counter 446 containing the parity address. Ifa parity error is signaled, the instruction decoder 443 does not issuethe increment signal 444 to the check address generator 445 and theaddress counter 446 remains pointed at the CAM word which produced theparity error.

FIG. 17 illustrates the operation of the instruction decoder 443 (FIG.14) in a self-invalidation operation. Starting at decision block 475,the instruction decoder monitors the reception of instructions via theIBUS to determine if any no-operation (no-op) instructions are receivedor if any idle intervals (i.e., no instruction transmission by the host)occur. If instructions requiring read, write or compare operations onthe CAM array are received, the instructions are executed as indicatedby block 477. On the other hand, if a no-op instruction (or idleinterval) is detected at decision block 475, the instruction decoderevaluates the error flag signal at block 479 to determine if the errordetector has detected an error in the CAM array. If the error flag isnot set, the instruction decoder returns to monitoring the incominginstructions for no-ops and idle intervals. If the error flag is set,then at block 481 the instruction decoder signals the address selectorto select the check address generator as the address source for a CAMarray access. At block 483 the instruction decoder signals the writecircuit to clear the validity bit for the CAM word selected by theaddress decoder, thereby invalidating the CAM word. The validity bit maybe cleared, for example, by a write to the selected CAM word (includingthe validity bit), or by signaling the validity storage within the CAMarray to reset the validity bit for the selected CAM word. Once thevalidity bit for the CAM word is reset, the CAM word may no longerproduce a match result during a compare operation. Accordingly, byperforming the self-invalidation operation, false matches due to thecorrupted CAM word may be prevented.

Depending on the amount of time required to perform theself-invalidation operation, it may be desirable for the-instructiondecoder to issue a busy signal (illustrated in FIG. 14 by dashed line447) to the host processor during a self-invalidation operation toprevent the host processor from issuing instructions that will result ina resource conflict within the CAM device 441 (e.g., host instructionsthat require read, write or compare operations to be performed on theCAM array). Alternatively, a self-invalidation operation may be abortedto perform a host requested operation in the event of a resourceconflict.

Although a self-invalidation operation has been described, theinstruction decoder 443 of FIG. 14 may also invalidate a corrupted CAMword in response to an explicit host instruction. In that case, thesequence of operations may similar to those shown in FIG. 17 (i.e.,blocks 481 and 483) followed by a signal to the error detector 455 toreset the error flag 132.

Still referring to FIG. 14, if the error address register 458 is amultiple-entry error address register, it may be desirable to access theCAM array (in a self-invalidation operation) using the error address 131instead of the check address 155. A signal path for this purpose isshown by dashed line 452 in FIG. 14. In this alternative configuration,the error address register may be advanced (e.g., by issuance of readsignal 151) after each self-invalidation operation to step through theerror addresses logged in the error address register 458. Accordingly,the CAM word for each entry in the error address register 458 may beinvalidated in a separate invalidation operation until the error addressregister is emptied.

FIG. 15 illustrates an error detector 460 that includes a multiple-entryerror address register to support self-invalidation. The error detectoris similar to the error detector 455 in FIG. 14, except that, inresponse to a load signal from the error detection circuit 465, an errorflag is stored in the error register 462 along with the correspondingcheck address 155. The error flags are designated E₀ to E_(x−1) in FIG.15. As the entries in the error address register 462 are advanced (e.g.,in response to read signal 151) the error flag associated with the newhead entry in the error address register 462 is used to provide theerror flag signal 132, and the error address at the head entry is usedto provide the error address output 131. By this arrangement, theinstruction decoder may step through the error address register entriesin a sequence of self-invalidation operations until an entry having areset error flag is reached, signifying that the error address register462 has been emptied.

In many CAM applications, a backup storage of the CAM array content ismaintained to allow the CAM array to be restored in the event of memoryloss or corruption. In such applications, self-invalidation of a CAMword may result in loss of coherency (i.e., sameness) between the CAMarray and the backup storage. Accordingly, it may be desirable toprovide an alternate error storage within a CAM device so that, as theCAM device performs selfinvalidation operations to clear errors in theerror address register, those same errors remain logged in the alternateerror storage. The host may then access the alternate error storage fromtime to time to determine whether errors have occurred and, if so, takeappropriate actions to maintain coherency between the CAM array and thebackup storage, and restore any invalidated CAM words. In oneembodiment, the alternate storage is substantially identical to theerror address register (and loaded at the same time) except that aself-invalidate indicator is included in each entry. The self-invalidateindicator is initially reset when an error is logged, but then set if aninvalidate operation takes place at the logged error address. In analternate embodiment, no such self-invalidate indicator is maintained.

Error Correction Code—CAM Device with Self-Correcting Function

Thus far, error checking has been described primarily in terms of paritychecking. FIG. 16 illustrates an alternative error detector 501 thatoperates on an error correction code stored with the CAM word instead ofa parity bit. Error correction codes (e.g., Hamming codes) are sequencesof bits formed, for example, by generating parity values for overlappinggroups of bits within the CAM word. The chief advantage of errorcorrection codes (ECCs) is that they permit location and thereforecorrection of a single bit error within a data value. ECCs also permitdetection of two-bit errors within a data value; errors that typicallywill not be detected by a parity-checking scheme because the two errorscancel one another insofar as they contribute to the even/odd parity ofthe data value.

As shown in FIG. 16, a CAM word 503 and corresponding ECC 505, whichtogether form a codeword, are supplied to a circuit called a syndromegenerator 507. The syndrome generator 507 effectively multiplies thecodeword with a parity check matrix (e.g., a Hamming matrix) to generatea parity check vector called a syndrome 508. In one embodiment, anynonzero bit in the syndrome 508 indicates that an error has occurred.Accordingly, the individual bits of the syndrome 508 are logically ORedin gate 511 to determine if the CAM word 503 has an error. The output ofOR gate 511 is then gated by the validity bit 506 for the CAM word 503in AND gate 513 to generate an error signal 514. The error signal 514 isapplied to the load input of an error address register 517 to cause theerror address register 517 to be loaded with an error address 536 at thenext transition of CLK 104. An ECC address generator 535 is used toaddress the CAM array for error detection purposes and also to supplythe error address 536 to the error address register 517.

The syndrome 508 is additionally supplied to an error correction circuit509 along with the CAM word 503. If the syndrome is nonzero (indicatingan error), and a single bit error has occurred, the error correctioncircuit 509 generates a corrected CAM word 510. In one embodiment, thecorrected CAM word 510 is generated by identifying a column of bits inthe parity check matrix that matches the bit pattern of the syndrome508. The position of the matching column within the parity check matrix(i.e., first column, second column, etc.) corresponds to the position ofthe bit in error within the CAM word 503. The bit in error is thenflipped (i.e., inverted) by the error correction circuit 509 to producethe corrected CAM word 510. As shown in FIG. 16, the corrected CAM word510 is supplied to the error address register 517 for storage in acorrected data array (CDATA).

If the syndrome 508 does not match one of the columns of the paritycheck matrix corresponding to a single bit error, a multi-bit error hasoccurred and CAM word output from the error correction circuit 509 isnot a corrected CAM word. Accordingly, a signal to indicate whether theCAM word 503 has been corrected, called a C bit 512, is output from theerror correction circuit 509 along with the CAM word 510. If asingle-bit error has been detected and corrected, the C bit 512 is setto indicate that the CAM word 510 has been error corrected by the errorcorrection circuit 509. If a multi-bit error has been detected, the Cbit 512 is reset to indicate that the CAM word 510 has not been errorcorrected. In the embodiment of FIG. 16, the C bit 512 is loaded intothe error address register 517 along with the CAM word 510, the errorsignal 514 and the error address 536.

Still referring to FIG. 16, the error bit and error address in the headentry of the error address register 517 are used to produce the erroraddress 531 and error flag signal 532. These singles may be used tosupport background error checking and self-invalidation operations asdescribed above. The storage of the corrected CAM words 510 and C bits512 fuirther enables a CAM device to perform a self-correction operationin which a corrupted CAM word within the CAM array is overwritten with acorrected CAM word from the error address register 517. Morespecifically, a write data multiplexer 540 is provided to select, inresponse to a path select signal 541 from the instruction decoder,either host-supplied data or a corrected CAM word from the error addressregister to be supplied to the write circuit. Also, the C bit at thehead entry of the error address register 517 is provided to theinstruction decoder to notify the instruction decoder that a correctedCAM word is available for use in a self-correction operation. In aself-correction operation, the write data multiplexer 540 outputs acorrected CAM word to the write circuit and the error address 531 issupplied to the address selector (not shown) to address the appropriateentry within the CAM array.

FIG. 18 illustrates the operation of an instruction decoder in aself-correction operation. As with the self-invalidation operation, theinstruction decoder monitors incoming host instructions in decisionblock 570 to determine whether a no-op instruction is received or if anyidle intervals occur. If instructions requiring read, write or compareoperations on the CAM array are received, the instructions are executedas indicated by block 572. If a no-op instruction (or idle interval) isdetected at decision block 570, the instruction decoder evaluates theerror flag signal at block 574 to determine if the error detector hasdetected an error in the CAM array. If the error flag is not set, theinstruction decoder returns to decision block 570 to monitor theincoming instructions for no-ops and idle intervals. If the error flagis set, then at block 576 the instruction decoder signals the addressselector to select the error address output by the error addressregister as the address source for a CAM array access. If theinstruction decoder determines the C bit to be set at decision block578, the instruction decoder signals the write data multiplexer at block580 to select the error address register to supply a corrected CAM wordfor a write operation. Subsequently, at block 582, the instructiondecoder signals the write circuit to write the corrected CAM word to theCAM array at the error address. Finally, at block 584, the instructiondecoder signals the error address register to advance to the next entry.Returning to decision block 578, if the C bit is not set, theinstruction decoder may perform a self-invalidate operation prior tosignaling the error address register to advance. For example, as shownin block 586, the instruction decoder may signal the write circuit toclear the validity bit for the CAM word indicated by the error address,thereby invalidating the CAM word within the CAM array.

As with the self-invalidation operation, it may be desirable for theinstruction decoder to issue a busy signal to the host processor duringa self-correction operation to prevent the host processor from issuinginstructions that may result in a resource conflict within the CAM array(e.g., host instructions that require read, write or compare operationsto be performed on the CAM array). This signal is indicated by dashedline 447 in FIG. 14. Also, as with the self-invalidation operation, theself-correction operation may be aborted to avoid delaying execution ofhost instructions. Further, it may be desirable to provide an alternateerror storage as described above so that, as the CAM device performsself-correction and self-invalidation operations to clear errors in theerror address register, those same errors remain logged in the alternateerror storage. The host may then access the alternate error storage fromtime to time to determine whether errors have occurred and, if so, takeappropriate actions to maintain coherency between the CAM array and thebackup storage, and restore any invalidated CAM words.

Generating a Sequence of Error Check Addresses

FIG. 19 illustrates the increment operation within an address generatorused to generate a sequence of error check addresses including, withoutlimitation, the parity addresses and ECC addresses described above. Inone embodiment, the error check address is.formed by three addresscomponents: a block address, a segment address, and a row address. Theblock address is used to select one of a plurality of storage blocks,the segment address is used to select one of a plurality of segmentswithin the selected storage block and the row address is used to select,within the selected segment, the row containing the CAM word (or partialCAM word) to be error checked. The block address component of the errorcheck address may be omitted in a CAM device that includes only a singlestorage block, and the segment address component may likewise be omittedin a CAM device that has only one segment per storage block.

For the purpose of the present description, the address generator isassumed to be implemented in a CAM device having K storage blocks, eachcontaining Z segments that are Y rows deep. Thus, the block addressranges from 0 to K−1, the segment address ranges from 0 to Z−1 and therow address ranges from 0 to Y−1.

Referring now to decision block 601, if an increment signal is detected,the row address (RA) of the error check address is evaluated in decisionblock 603 to determine if the row address has reached the row limit(i.e., the final row address, Y−1). This may be accomplished, forexample, by a comparison of the row address and row limit in acomparator. Other techniques and circuits may also be used to detectwhen the row limit has been reached.

If the row address has not reached the row limit, the row address isincremented by one in block 605 to complete the increment operation. Ifthe row address has reached the row limit, the row address is reset tozero in block 607, followed by evaluation of the segment address (SA) indecision block 609 to determine if the segment address has reached thesegment limit (i.e., Z−1). If the segment address has not reached thesegment limit, the segment address is incremented by one in block 611 tocomplete the increment operation. If the segment address has reached thesegment limit, the segment address is reset to zero in block 613,followed by evaluation of the block address (BA) in decision block 615to determine if the block address has reached the block limit (i.e.,K−1). If the block address has not reached the block limit, the blockaddress is incremented by one in block 617 to complete the incrementoperation. If the block address has reached the block limit, the blockaddress is reset to zero in block 619 to complete the incrementoperation.

The increment operation may be changed in numerous ways in alternativeembodiments. For example, in the increment operation described above,the row address is effectively treated as the least significantcomponent of the error check address, followed by the segment addressand then the block address. Any order of significance may be assigned tothe row, segment and block addresses in alternative embodiments. Forexample, the block address may be incremented from 0 to K−1 beforeeither the segment or row addresses are incremented, or the segmentaddress may be incremented from 0 to Z−1 before either the block or rowaddresses are incremented.

In another implementation of the increment operation, one or more of thecomponents of the error check address may be incremented by values otherthan one. For example, assuming Y is even, the row address component maybe incremented by any odd value with modulo Y arithmetic being used tocalculate the result (the decision block 603 of FIG. 19 may be modified,for example, to test for RA=Y−1−i, where i is the increment value).Also, the increment may be negative instead of positive such that theaddress components are counted down instead of up. Finally, theincrement operation described in reference to FIG. 19 is used toseparately address each row of each segment of each block. Inalternative embodiments, the each segment of a given block may beaccessed together to concurrently error check all the segments for agiven row address component; or each segment within each of the blocksmay be accessed together to concurrently error check the same row acrossall segments and all blocks. In yet another embodiment, the segmentaddress may be incremented by a selectable amount according to theconfiguration of the corresponding storage block. For example, if thestorage block is configured for a x2 CAM word, the segment address maybe incremented by two instead of one in block 611 of FIG. 19.

Embodiment without Validity Bits

Each of the CAM device embodiments described thus far have includedvalidity bits to indicate whether corresponding CAM words are valid andto gate the error flag signal accordingly. In alternative embodimentsthe validity bit storage may be omitted from the CAM device and thegating circuitry (e.g., element 222 of FIGS. 6 and 7, element 398 ofFIG. 12, element 407 of FIG. 13, and element 513 of FIG. 16) omittedfrom the error detector. In one embodiment, for example, each of therows of CAM cells may initially be filled with a default value (e.g.,all ‘0’s) and the parity bit (or bits) or other error check values forthe row set accordingly. By this arrangement, all CAM words in the CAMarray are effectively ‘valid’ in that known values together withappropriate error checking values have been stored in each of the rowsof CAM cells. Accordingly, the error checking embodiments describedherein may be modified by removing the validity-based gating circuitry(e.g., element 222 of FIGS. 6 and 7, element 398 of FIG. 12, element 407of FIG. 13, and element 513 of FIG. 16), and then using the remainingcircuitry to detect and log errors, and to perform self-correctionoperations. Self-invalidation operations may effectively be performed byresetting a corrupted CAM word to the default value.

System Structure and Operation

FIG. 20 illustrates a system device 651 that includes a host processor650 (e.g., general purpose processor, digital signal processor, networkprocessor, ASIC, etc.) and a CAM device 655 according to one of theembodiments described herein. The system device may be, for example, anetwork switch or router, or any other type of device in which the fastcompare capability of the CAM device 655 may be useful.

The host processor 650 issues addresses, comparands, and instructions tothe CAM device 655 via the address, comparand and instruction buses,respectively (i.e., ABUS 141, CBUS 143 and EBUS 145), and receives CAMindices and status information from the CAM device 655 via an addressand status bus 149 (ADS). Though not shown in FIG. 20, the address andstatus bus 149 may additionally be coupled to supply CAM indices to anassociated storage. The CAM indices may alternatively (or additionally)be output to the host processor 650 and/or the associated storage via adedicated signaling path. Also, in alternative embodiments, one or moreof the buses (e.g., ABUS, CBUS, IBUS, ADS) may be omitted and thecorresponding information time multiplexed onto another of the buses.Further, the CAM device 655 and host processor 650 may be implemented indistinct integrated circuits (ICs) and packaged in distinct IC packages,or in a single IC (e.g., in an ASIC, system-on-chip, etc.), or in an ICpackage that includes multiple ICs (e.g., a multi-chip package, paperthin package, etc.).

Still referring to FIG. 20, the error flag signal 132 is preferablyoutput from the CAM device 655 to the host processor 650 via a dedicatedsignal path (EFLAG), while the error address value 131 is preferablyoutput from the CAM device 655 to the host processor 650 via the addressand status bus 149. Alternatively, the error address 131 may be outputto the host processor via a dedicated path as shown by the dashed linelabeled ERROR ADDR in FIG. 20. Also, as discussed above, the error flagsignal may alternatively (or additionally) be output to the hostprocessor via the address and status bus 149. Further, a busy signal 447may be output from the CAM device 655 to the host processor 650 tosignal the host processor 650 that the CAM device 655 is busy performinga self-invalidation operation or self-correction operation as describedabove.

The host processor 650 is also coupled to a backup storage 657 which isused to store a backup copy of the CAM words stored in the CAM device655. The backup storage 657 is preferably a non-volatile storage such asa battery-backed semiconductor storage, an electrically programmableread only memory (EPROM), a flash EPROM, or a magnetic or opticalmedium, but any type of data storage device may be used in alternativeembodiments.

FIG. 21 illustrates the operation of the host processor of FIG. 20according to one embodiment. Initially, at decision block 680, the hostprocessor samples the error flag signal to determine whether the CAMdevice has detected an error in a CAM word. Sampling the error flagsignal may involve, for example, sensing the error flag signal at adedicated receiver of the host processor or issuing an instruction tothe CAM device to output the error flag signal onto the address andstatus bus (or other signal line). If the error flag is not set, thehost processor executes the next scheduled instruction, if any, in block682. If the error flag is set, the host processor issues a instructionto the CAM device to output the error address (e.g., an “EA READ”instruction) in block 684. Some time later, at block 686, the hostprocessor receives the error address from the CAM device, for example,via the address and status bus. At block 688, the host processor usesthe error address to index (i.e., address) a backup storage device toretrieve backup data. After the backup data has been retrieved, the hostprocessor issues an instruction to the CAM device at block 690 to writethe backup data to the CAM array at the error address, thus overwritingthe corrupted CAM word with an error free value.

Match Error Signaling

FIG. 23 illustrates the use of CAM device 100 of FIG. 1 in an exemplarynetwork switching or routing application. As shown, packet traffic flowsthrough a network processing unit (NPU) 703 which issues read, write andcompare instructions to the CAM device 100. For example, the NPU 703 mayoutput a comparand to the CAM device 100 in the form of selected fieldsof an incoming packet, and instruct the CAM device 100 to perform acompare operation. The CAM device 100 responds by comparing thecomparand to CAM words stored within the CAM array and outputting amatch index and match flag (or flags) according to the comparisonresult.

Although the NPU 703 may act as a host processor (e.g., as described inreference to FIGS. 20 and 21), a central processing unit (CPU) 701 isoften provided to perform some or all of the host processor actionsdescribed herein. For example, the CPU 701 may monitor an error flagsignal from the CAM device 100 and take corrective action when an erroris detected in a CAM word stored within the CAM device 100 (e.g.,overwrite the corrupted CAM word with a data word from a backupstorage). Depending upon the speed with which the CPU 701 responds to anerror indication, the NPU 703 may request the CAM device 100 to performany number of compare operations before the CPU 701 takes correctiveaction. If, during a given compare operation, a highest priority matchis detected between a comparand value and a corrupted CAM word, theresulting match index may be invalid (i.e., if the defective bits withinthe corrupted CAM word are not masked in the compare operation, thematch index will have resulted from a false match and therefore will beinvalid). Accordingly, any match index generated between the time anerror is detected within the CAM device 100 and the time the CPU 701 orother device takes corrective action may be invalid and may thereforeresult in incorrect routing or classification of the correspondingpacket.

FIG. 24 illustrates a match error detector 705 that may be includedwithin the CAM device 100 of FIG. 1 (or CAM device 441 of FIG. 14) togenerate a match error signal 732. The match error signal 732, whenasserted, indicates that a match index 174 generated during a compareoperation has resulted from a match with a corrupted CAM word. An NPU orother device receiving the match index 174 may also receive the matcherror signal 732 and therefore decide, according to the state of thematch error signal 732, whether to perform a given processing operation(e.g., forwarding or classification) on the corresponding packet. Therecipient of an asserted match error signal 732 may also take otheraction, such as notifying another processor of the error condition,notifying another network node (e.g., router, switch, etc.) of the errorcondition so that the network node may take remedial action (e.g.,rerouting network traffic), saving the processing operation that yieldedthe match error signal 732 for later retry, and so forth.

Still referring to FIG. 24, the match error detector 705 receives anN-bit match index 174(0)-174(N−1) from a priority encoder 114, and anN-bit error address 131(0)-131(N−1) and error flag signal 132 from anerror detector 107. The error address 131 and error flag signal 132 maybe generated, for example, as described above in reference to FIG. 6.Match error detector 705 is a compare circuit that compares bits of theerror address 131 with corresponding bits of the N-bit match index 174to generate a match error signal 732. For example, as shown in FIG. 27,a set of N exclusive NOR gates 706 within the match error detector 705compare respective bits of the match index 174(0)-174(N−1) withcorresponding bits of the error address 131(0)-131(N−1) and outputrespective result signals to a logic AND gate 707. The logic AND gate707 also receives the error flag signal 132 from the error detector 107.Each of the logic NOR gates 706 outputs a logic high result signal ifthe input error address bit and match index bit match (i.e., are in thesame logic state), and a logic low result signal if the bits do notmatch. Accordingly, if the error flag signal 132 is asserted (indicatingthat the error address is valid), and the match index 174 matches theerror address 131 bit-for-bit, then logic AND gate 707 will assert thematch error signal 732 to indicate that the match index has resultedfrom a match with a corrupted CAM word. If the error flag signal 132 isdeasserted (indicating that the error address is not valid) or if anybit (or bits) of the match index 174 does not match the correspondingbit of the error address 131, then the logic AND gate 707 will deassertthe match error signal 732. In this way, a NPU or other processor mayreceive, for each match index 174 generated between the time a corruptedCAM word is detected within the CAM device and the time that correctiveaction is taken, an indication of whether the match index 174 hasresulted from a match with the corrupted CAM word. Thus, if a processorreceives a match index 174 together with an asserted match error signal732, the processor may be programmed not to forward or classify thecorresponding packet based on the match index, thereby avoidingincorrectly routing or classifying the packet.

FIG. 25 illustrates a CAM device 700 according to an embodiment thatincludes an error CAM 715 to assert a match error signal 732 if a matchindex 174 matches any of a plurality of error addresses. In addition tothe error CAM 715, the CAM device 700 includes a CAM array 101(optionally including validity bits 102), address circuit 103,instruction decoder 105, flag circuit 112, priority encoder 114,comparand register 115, read/write circuit 161 and error detectioncircuit 711. The CAM device 700 also includes interfaces to receive aninstruction bus 145, address bus 141, comparand bus 143 and a clock line(providing clock signal 104) as described in reference to FIG. 1.Further, the instruction decoder 105, address circuit 103, CAM array101, comparand register 115, read/write circuit 161, flag circuit 112and priority encoder 114 are coupled to one another and operategenerally as described in reference to FIGS. 1-5. That is, theinstruction decoder 105 issues enable and select signals (126 and 118)to the address circuit 103 to control the generation of a sequence ofcheck addresses 155. For each check address 155 in the sequence, theaddress circuit 103 activates a corresponding one of a plurality of wordlines 181 to enable a selected CAM word to be read from the CAM array101 by the read/write circuit 161. An error detection circuit 711, whichmay be implemented, for example, by the parity check circuit 201 andlogic gate 222 described above in reference to FIG. 6 (or any of theother error detection embodiments described above), is coupled toreceive the selected CAM word from the read/write circuit 161 and tooutput an error signal 712 to the error CAM 715. The error detectioncircuit 711 asserts the error signal 712 upon detecting an error in theselected CAM word and deasserts the error signal 712 if no error isdetected.

In one embodiment, the error CAM 715 includes an error CAM array and aqueue control circuit that establishes a first-in-first-out (FIFO)protocol for storing error address values (i.e., check addresses 155)within the error CAM array. That is, the queue control circuit forms aqueue of storage locations within the error CAM array, and, in oneembodiment, includes a read pointer that points to the least recentlystored (i.e., oldest) error address value within the queue (the head ofthe queue), and a write pointer that points to the most recently storederror address value within the queue (the tail of the queue). If theerror signal 712 is asserted, the error CAM 715 advances the writepointer to point to a next available storage location, the new queuetail, then loads the check address 155 for the selected CAM word (i.e.,the CAM word determined to have an error) into a storage locationindicated by the write pointer (alternatively, the check address may beloaded prior to advancing the write pointer). If an advance signal 708is asserted by the instruction decoder 105, the error CAM 715 clears avalidity value stored in the queue head location, thereby releasing theoldest error address value from the queue, then advances the readpointer to establish a storage location containing the next leastrecently stored error address value as the new head of the queue. In oneembodiment, the error address at the queue head is output from the errorCAM 715 via a dedicated read port to provide the error address signal131. As with embodiments discussed above, the error address signal 131may be output from the CAM device 700 via a dedicated interface, via amultiplexed interface (e.g., to a status bus), via a status word, andvia any other output node of the CAM device. As shown in FIG. 25, theerror CAM 715 may receive a reset signal 153 to reset the error CAM 715during initialization of CAM device 700.

As discussed above, the error checking engine implemented by the checkaddress generator (i.e., within address circuit 103), read/write circuit161 and error detection circuit 711 may operate in the background ascompare operations are performed within the CAM device 700. That is,concurrently with checking a selected CAM word for error, a comparandvalue received via the CBUS 143 (and optionally stored in the comparandregister 115) may be compared with the contents of the CAM array 101 todetermine whether the comparand value matches any valid CAM words storedwithin the CAM array 101. A plurality of match lines 182, coupled torespective rows of CAM cells within the array 101 (as described inreference to FIG. 5), are provided to deliver match signals to the flagcircuit 112 and the priority encoder 114, each match signal indicatingwhether a CAM word stored within a respective row of CAM cells matchesthe comparand value. If any of the match signals is asserted, therebyindicating a match, the flag circuit 112 outputs a match flag signal 176(and, optionally, a multiple match flag signal if more than one of thematch signals is asserted), and the priority encoder 114 outputs a matchindex 174 that corresponds to the highest priority row of CAM cellscontaining a CAM word that matches the comparand value.

The match index 174, in addition to being output from the CAM device700, is input to the error CAM 715 for comparison with error addressvalues queued therein. If the match index 174 matches any of the erroraddress values, the match error signal 732 is asserted to indicate thatthe match index corresponds to a corrupted CAM word within the CAM array101. The match error signal 732 may then be used by the recipient device(e.g., NPU, CPU, etc.) as discussed above in reference to FIG. 24 tomake packet processing decisions.

It should be noted that the multiple-entry error address register 289 ofFIG. 7 may be used to implement CAM array 715 in one embodiment, witheach error address entry within the multiple-entry error addressregister being formed by a respective row of CAM cells. FIG. 26illustrates an alternative embodiment of a CAM device 750 that includesan error CAM. The CAM device 750 includes a CAM array 101, addresscircuit 103, instruction decoder 105, flag circuit 112, priority encoder114, comparand register 1 15, read/write circuit 161 and error detectioncircuit 711, each coupled as described in reference to FIG. 25 (e.g.,via internal signals 118, 126, 181, 182, and to buses 141, 143 and 145),and each cooperating as described in reference to FIG. 25 to generate amatch flag signal (or signals) 176, a match index 174 and an errorsignal 712.

The CAM device 750 differs from the CAM device 700 of FIG. 25 in thatthe error logging and match error detection functions are split betweenan error log circuit 731 and an error CAM 751, respectively, rather thanbeing performed within a single error CAM circuit. The error log circuit731 may include, for example, the error address register 203 and S/Rflip-flop 224 described in reference to FIG. 6, or the multiple-entryerror address register 289 of FIG. 7, or any other circuits for storingerror addresses and outputting the error address signal 131 and errorflag signal 132. The error CAM 751 includes circuitry to compare thematch index 174 to error address values stored within the error CAM 751and to output a match error signal 732 if the index matches any of theerror address values. The error CAM 751 may be implemented in the samemanner as error CAM 715 of FIG. 25 , except that the dedicated read portfor outputting the error address 131 may be omitted. The reset signal153 may be used to reset both the error log 731 and the error CAM 751during device initialization. Also, the advance signal 735 may be usedto advance the queue head within the error CAM 715 as discussed inreference to FIG. 25.

FIG. 27 illustrates an embodiment of the error CAM 715 of FIG. 25 ingreater detail. The error CAM 715 includes an error CAM array 800,read/write circuit 803, queue control circuit 807, and match logiccircuit 831. The CAM array 800, is organized in rows and columns of CAMcells with each row of CAM cells including a number of storage CAM cells801 and a validity CAM cell 802. Within a given row, the storage CAMcells 801 are used to store an error address value, while the validityCAM cell 802 is used to store a validity value that indicates whether avalid error address value is stored within the corresponding storage CAMcells 801. In one embodiment, each storage CAM cell 801 includes amemory element to store a single bit of an error address value, and eachrow of CAM cells includes a sufficient number of storage CAM cells 801to store an N-bit error address value, where N is at least log₂R (Rbeing the number of independently addressable storage locations in theCAM array 101 of FIG. 1 so that log₂R is the size, in bits, of an erroraddress value that decodes to a unique row or row segment within thedata CAM array 101 of FIGS. 25 and 26). In alternate embodiments, moreor fewer storage CAM cells 801 may be included in each row of CAM cellswithin the error CAM array 800. For example, in a CAM device that may becoupled to additional CAM devices in a cascade arrangement (effectivelymultiplying the size of the data CAM array 101 of FIGS. 25 and 26 by thenumber of cascaded devices), additional storage CAM cells 801 may beincluded within each row of the error CAM array 800 to uniquely identifyone of the cascaded CAM devices.

Still referring to FIG. 27, each row of CAM cells within error CAM array800 is coupled to the queue control circuit 807 via a respective readword line 823 and write word line 825, and to the match logic circuit831 via a respective match line 827. Each column of CAM cells, includingthe column of validity CAM cells 802, is coupled to a pair of comparandlines, CL and {overscore (CL)}, to receive a comparand bit and itscomplement; to a pair of write bit lines, WBL and {overscore (WBL)}, toreceive an error address value during a load operation; and to a pair ofread bit lines, RBL and {overscore (RBL)}. In one embodiment, the readbit lines coupled to the columns of storage CAM cells form a read portfor outputting the error address signal (i.e., signal 131 of FIG. 25).The read bit lines coupled to the column of validity CAM cells 802 mayalso be used to read out the validity value(s) stored therein. The readbit lines (or the write bit lines) coupled to the column of validity CAMcells 802 may also be used during or after a queue advance operation toclear the validity value stored within the storage location at the headof the queue. For example, after the error address stored in a row ofCAM cells 801 is read, the error address may be used to select thevalidity CAM cell 802 of the same row (either in the same or asubsequent clock cycle) and the validity value overwritten via the reador write bit lines to an invalid state. Alternatively, while the row ofCAM cells 801 is selected for reading (e.g., via the read word lineRWL), the corresponding validity CAM cell 802 of the same row may beselected (e.g., by the RWL or WWL), and may be written (simultaneouslyor sequentially) to an invalid state over the read or write bit lines.The component bits of the match index 174 constitute the comparand bitssupplied to the CAM cells 801 during a compare operation, whilededicated logic high and logic low inputs (shown, for example, as supplyvoltage and ground reference connections, respectively, in FIG. 27) formthe comparand value provided to the validity CAM cells 802. Inalternative embodiments, the signals provided to the validity CAM cells802 via the comparand signal lines may be programmable rather than thepair of fixed-level signals shown in FIG. 27.

The read/write circuit 803 is used in conjunction with the queue controlcircuit 807 to store error address values in the CAM array 800. Asdiscussed above, in one embodiment, the queue control circuit 807includes read and write pointers that enable the error CAM array 800 tobe operated as a queue. The write pointer points to a row of CAM cellsthat constitute a tail storage location of the queue, and the readpointer points to a row of CAM cells that constitute a head storagelocation of the queue. Error address values are loaded into the queue atthe tail storage location, and read out of the queue at the head storagelocation. More specifically, when an error signal 712 is detected at aload input of the queue control circuit 807, the queue control circuit807 increments the write pointer to point to an available row of CAMcells within the error CAM array 800, then activates a word line 825indicated by the write pointer to select (i.e., enable) the row of CAMcells to receive an error address via the write bit lines, WBL and{overscore (WBL)}. The read/write circuit 803 receives an error addressvalue from the address circuit (e.g., element 103 of FIGS. 25 and 26) inthe form of a check address 155 and drives the constituent bits of theerror address value onto respective pairs of write bit lines for storagewithin the selected row of storage CAM cells 801. Also, the read/writecircuit 803 drives a validity value onto the write bit lines coupled tothe column of validity CAM cells 802 so that the validity CAM cell 802corresponding to the selected row of storage CAM cells 801 will store avalid indication for the newly stored error address value.

In one embodiment, the read pointer is used to select the row of CAMcells coupled to the read port formed by the read bit lines, RBL and{overscore (RBL)}. More specifically, the read pointer is decoded toactivate a read word line 823 coupled to the row of CAM cells at thehead of the queue, thereby enabling the error address at the head of thequeue to be output via the read bit lines as the error address signal131. When an advance signal 735 is asserted, the read/write circuit 803drives an invalidity value onto the read bit lines coupled to the columnof validity CAM cells 802 to clear the validity indication for the erroraddress at the head of the queue. After the validity value at the headof the queue is cleared, the queue control circuit increments the readpointer to establish a new storage location as the head of the queue.

CAM cells 801 may be any type of CAM cell including, without limitation,binary, ternary, NAND, NOR, volatile or nonvolatile. Additionally, asingle read bit line may be used instead of the pair of read bit lines(RBL and {overscore (RBL)}), a single write bit line may be used insteadof the pair of write bit lines (WBL and {overscore (WBL)}), and/or asingle comparand line may be used instead of the pair of comparand lines(CL and {overscore (CL)}). Further, instead of providing separate theread bit lines, write bit lines, and comparand lines, only one or twosignal lines (or signal line pairs) may be provided in alternativeembodiments with the signals for the omitted bit lines and/or comparandlines multiplexed onto the provided signal lines.

The reset signal 153 is input to the queue control circuit 807 and tothe column of validity CAM cells 802. When the reset signal 153 isasserted, the read and write pointers within the queue control circuitare reset to an initial state, and the validity value within each of thevalidity CAM cells 802 is cleared.

When a match index 174 is received within the error CAM array 800 (i.e.,via the comparand signal lines), the match index is simultaneouslycompared with each error address value stored within the CAM array 800.In the embodiment of FIG. 27, if a bit of the error address value storedwithin a given CAM cell 801 does not match the corresponding bit of thematch index, a compare circuit within the CAM cell 801 will force thematch line 827 to signal a mismatch condition. Similarly, if the valuestored within a given validity CAM cell 802 indicates that thecorresponding CAM cells 801 do not contain a valid error address value,the validity CAM cell 802 will force the match line 827 to signal amismatch condition. If a valid error address value stored within a givenrow of CAM cells matches the match index, then the corresponding matchline 827 will signal a match condition. In the embodiment of FIG. 26,the match signal present on a given match line effectively represents awired NOR of mismatch signals output by the individual CAM cells 801coupled to the match line. That is, the active low mismatch indicationsfrom each of the CAM cells 801 are effectively ORed with one another toproduce an active high match signal on the corresponding match line 827.In an alternate. embodiment, the match signals output by each of the CAMcells 801 in a given row may be logically combined in a logic gate(e.g., an AND, OR, NAND or NOR logic gate) with an output of the logicgate being used to set the signal level on match line 827. Moregenerally, any circuit for generating a signal indicative of whether anerror address value stored within a row of CAM cells matches the matchindex 174 may be used without departing from the spirit and scope of thepresent invention.

In one embodiment, the match logic circuit 831 is implemented by an ORlogic circuit so that, if a match signal is asserted to a high logicstate (i.e., has a logical state indicative of a match condition) on anyof the match lines 827, the match logic circuit 831 will assert thematch error signal 732. Other logic circuits may be used to implementthe match logic circuit 831 in alternative embodiments.

FIG. 28 illustrates the queue control circuit 807 of FIG. 27 accordingto one embodiment. The queue control circuit 807 includes a writepointer 861, write address decoder 862, read pointer 863, read addressdecoder 864, and flag logic circuit 865. In the embodiment of FIG. 28,the read and write pointers 861, 863 are each implemented by an upcounter having a strobe input (UP), a reset input (RST) and a countoutput (CNT). A count value maintained within each counter 861, 863 isincremented by one in response to a rising edge at the strobe input,reset to a start count in response to a high logic level signal at thereset input, and output as a binary-encoded set of bits at the countoutput. In one embodiment, each of the counters 861, 863 is a modulo Mcounter that counts up from zero to M−1, then rolls back to zero.Counter.863 is reset to zero and counter 861 is reset to M−1 (andtherefore will roll to 0 during the first load operation following areset) when the reset signal 153 is asserted. In an alternateembodiment, the counters 861 and 863 may default to any value (includingdifferent values from one another) upon assertion of reset signal 153,and may count down instead of up. Also, instead of incrementing by onein response to a rising edge signal at the strobe input, the countersmay be incremented by any value, positive or negative.

A queue load operation is initiated when a full signal 855 is deassertedby the flag logic circuit 865 and a load signal 712 (i.e., error signal712 of FIGS. 25, 26 and 27) is asserted. More specifically, logic ANDgate 851 responds to the assertion of the load signal 712 and thedeassertion of the full signal 855 by passing a rising edge of clocksignal 804 to the strobe input of the write pointer 861 (i.e., as writestrobe signal 852), thereby incrementing the count value within thewrite pointer 861. Note that clock signal 804 may be the clock signal104 discussed above, a clock signal derived from clock 104, or anotherclock signal or control signal.

The count value maintained within the write pointer 861 constitutes aqueue tail address and is output to the write address decoder 862. Inone embodiment, the write address decoder 862 is a log₂M to M decoderwhich asserts one of M write enable signals 869 according to the queuetail address (M being the number of independently addressable rows ofCAM cells within the error CAM array). The M write enable signals areinput, respectively, to a set of M logic AND gates 873 which are used todrive the write word lines 825. Each of the logic AND gates 873 alsoreceives the load signal 712 and an inverted version of clock signal 804via inverter 871. Accordingly, at a falling edge of the clock signal804, and while the load signal 712 is asserted, the asserted one of thewrite enable signals 869 enables a corresponding one of the logic ANDgates 873 to activate the write word line that corresponds to theincremented queue tail address. In one embodiment, the load signalremains asserted long enough for the read/write circuit 803 (describedabove in reference to FIG. 27) to write an error address value andvalidity value into the row of CAM cells selected by the activated writeword line.

The count value maintained within the read pointer 863 constitutes aqueue head address and is output to the read address decoder 864. In oneembodiment, the read address decoder 864 is also a log₂M to M decoderwhich activates a selected one of M read word lines 823 according to thequeue head address. Unlike write word lines which are activated onlyduring load operations, the selected read word line 823 remainsactivated until an advance operation is performed to increment the readword line selection. By this arrangement, the error address storedwithin the row of CAM cells coupled to the selected read word line isoutput as an error address signal via the read port formed by the readbit lines, RBL and {overscore (RBL)}, described in reference to FIG. 27.

Reflecting upon the operation of the write pointer and write addressdecoder, it will be appreciated that, prior to initiation of a loadoperation, the write pointer points to a row of CAM cells containing themost recently stored error address value. During a load operation, thewrite pointer is first incremented to point to an available storagelocation (effectively advancing the queue tail), then an error addressvalue is loaded into the storage location. This order of operation maybe reversed in alternative embodiments by first loading an error addressvalue into an available storage location, then incrementing the writepointer to point to a next available storage location. In such anembodiment (which may be achieved, for example, by removing inverter 871and inverting the clock signal at the input to logic AND gate 851), thewrite pointer 861 may be reset to the same initial value as the readpointer 863 in response to the reset signal 153.

A queue advance operation is initiated when an empty signal 857 isdeasserted by the flag logic circuit 865 and the advance signal 735 isasserted. More specifically, logic AND gate 853 responds to assertion ofthe advance signal 735 and deassertion of the empty signal 857 bypassing a rising edge of clock signal 804 to the strobe input of theread pointer 863 (i.e., as read strobe signal 854), thereby incrementingthe queue head address.

Reflecting on the operation of the queue control circuit 807, it can beseen that, at any given time, the read and write pointers 861 and 863define which rows of CAM cells within the error CAM array (e.g., element800 of FIG. 27) are included within the queue. Accordingly, in analternative embodiment, the validity CAM cells 802 and associated signallines may be omitted from the CAM array 800 of FIG. 27 and the read andwrite pointers may be used to disable match indications for those rowsof CAM cells not included within the queue.

FIG. 29 illustrates an embodiment of the flag logic circuit 865 of FIG.28. The flag logic circuit 865 includes a counter 891 that maintains aqueue depth count, and compare circuits 892, 894 and 896 to determinewhen the queue depth count is at a maximum (M), near maximum (greaterthan K), and zero, respectively. Logic AND gates 893 and 895 areprovided to generate conditioned read and write strobe signals 866 and867, respectively. More specifically, logic AND gate 893 receives thewrite strobe signal 852 at a non-inverting input, and receives the readstrobe signal at an inverting input. By this arrangement, a rising edgeof the write strobe signal 852 is passed through the logic AND gate 893except when the read strobe signal 854 is high. Similarly, logic ANDgate 895 receives the write strobe signal at an inverting input and theread strobe signal 854 at a non-inverting input so that a rising edge ofthe read strobe signal 854 passes through the logic AND gate 895 exceptwhen the write strobe signal 852 is high. By this arrangement, theconditioned read and write strobe signals 866, 867 correspond to theread and write strobe signals 852, 854, respectively, except that theconditioned read and write strobe signals 866, 867 are prevented frombeing in a logic high state (or transitioning to a logic high state) atthe same time. The counter 891 receives conditioned write and readstrobe signals 866, 867 at respective up and down count inputs, andincludes logic to increment the queue depth count by one in response tothe conditioned write strobe signal 866 and decrement the queue depthcount by one in response to the conditioned read strobe signal 867.Initially, and whenever the reset signal 153 is asserted, the queuedepth count is reset to zero, causing compare circuit 896 to assert theempty signal 857. Assertion of the empty signal 857 disables logic ANDgate 853 of FIG. 28 from asserting the read strobe signal 854.Accordingly, queue advance operations are blocked when the queue isempty. During a load operation, assertion of the write strobe signal 852causes the queue depth count to be incremented by one. Accordingly,after the first load operation, the queue depth count is no longer equalto zero so that the empty signal 857 is deasserted and queue advanceoperations are permitted. If the queue depth count reaches K+1, K beingan integer value between 0 and M, the almost full signal 859 is outputto indicate the near full condition of the error CAM array. In oneembodiment, the value of K (i.e., the warning value) may be maintainedin a register or other storage element within a CAM device and runtimeprogrammed by a host processor. In another embodiment, the warning valuemay be onetime programmable, for example, by blowing fuses or otherwiserecording a non-volatile value within the CAM device. Alternatively, thewarning value (K), may be set to reflect a half-full state, an almostempty state, or any other indication of the number of error addressvalues stored in the error CAM array. Also, any number of additionalwarning values and corresponding compare circuits 894 may be provided togenerate a plurality of queue status signals in alternative embodiments.If the queue depth count reaches M, then the queue is full (i.e., M moreload operations have been performed than advance operations), and thecomparator 892 asserts the full signal 855. Assertion of the full signal855 disables logic AND gate 851 of FIG. 28 from asserting thewrite.strobe signal 852, thereby preventing queue load operations.

The empty signal 857, full signal 855 and almost full signal 859 may beoutput to a processor (or other device) via a dedicated output interfaceor via a multiplexed interface. In another embodiment, the empty, full,and almost full signals are used to set corresponding bits within astatus word that may be read by a processor (or other device) in astatus read operation. Also, circuitry to generate the almost fullsignal may be omitted altogether.

By preventing the conditioned read and write strobe signals 866, 867from transitioning to a high logic state at the same time, the logic ANDgates 893, 895 prevent the queue depth count from being changed during aclock cycle in which both the write strobe signal 852 and the readstrobe signal 854 are asserted. Different types of circuits within (orexternal to) the counter 891 may be used for this purpose in alternativeembodiments. Also, the flag logic circuit 865 may be implementeddifferently in alternative embodiments. For example, rather thanmaintain a queue depth count, the flag logic 865 may compare the countoutputs of the write pointer 861 and the read pointer 863 to determinefull, almost full and empty conditions.

FIG. 30 illustrates the CAM cell 801 of FIG. 27 according to oneembodiment. The CAM cell 801 is a multi-ported CAM cell that includesstorage element 901, compare circuit 910 and switch circuits 906-909. Awrite port formed by write bit lines WBL and {overscore (WBL)} iscoupled to the storage element 901 via switch circuits 907 and 906,while a read port formed by read bits lines RBL and {overscore (RBL)} iscoupled to the storage element 901 via switch circuits 909 and 908. Whenwrite word line 825 is activated, switch circuits 906 and 907 areswitched on, enabling a data value present on the write bit lines to bestored within the storage element 901. Similarly, when the read wordline 823 is activated, switch circuits 908 and 909 are switched on,enabling the data value stored within storage element 901 to be outputonto the read bit lines. The compare circuit 910 is coupled to receivethe data value from the storage element 901, and is coupled to acomparand port formed by comparand signal lines CL and {overscore (CL)}.During a compare operation, the compare circuit receives a comparandvalue via the comparand port, and compares the comparand value to thestored data value. The compare circuit outputs a match signal to affecta logical state of the match line 827 according to the compare result.

FIG. 31 illustrates an embodiment of the multi-ported CAM cell 801 ofFIG. 30 in greater detail. As discussed above, the CAM cell 801 is amulti-ported CAM cell that includes storage elements 901, a comparecircuit 910. In the embodiment of FIG. 31, transistor switches 917-920,coupled as pass gates, are used to implement the switch circuits andpass gates 906-909, respectively, of FIG. 30. The storage element 901 isdepicted in FIG. 31 as being implemented by back-to-back coupledinverters, though different types of storage elements may be used inalternative embodiments including, without limitation, dynamic storageelements (typically implemented by a single transistor and chargestorage element), non-volatile storage elements or any other type ofstorage element that can be used to store digital data.

The storage element 901 is coupled to write bit lines WBL and {overscore(WBL)} via the pass gates 917 and 918 respectively. Gate terminals ofthepass gates 917 and 918 are coupled to a write word line 825 so that,when the write world line 825 is activated, the complementary signalspresent on the write bit lines are applied to the storage element 901 tostore a data value therein. The storage element 901 is coupled to readbit lines RBL and {overscore (RBL)} via pass gates 919 and 920. Gateterminals of the pass gates 919 and 920 are coupled to a read word line823 so that, when the read word line 823 is activated, the data valuestored within storage element 901 is output as a complementary pair ofsignals on the read bit lines.

Still referring to FIG. 31, the compare circuit 910 includes transistors911, 912, 913 and 914. Transistors 911 and 912 are coupled in seriesbetween a match line 827 and a reference potential (ground in thisexample), with a gate terminal of transistor 911 being coupled toreceive the data value from storage element 901 and a gate terminal oftransistor 912 being coupled to receive a complemented comparand bitfrom comparand line {overscore (CL)}. Similarly, transistors 913 and 914are coupled in series between the match line 827 and the referencepotential, with a gate terminal of transistor 913 being coupled toreceive a complemented version of the data value stored in storageelement 901, and a gate terminal of transistor 914 being coupled toreceive an uncomplemented comparand bit from comparand line CL. By thisarrangement, if the comparand value and the stored data value do notmatch, the match line 827 will be pulled low through one of thetransistor pairs 911/912 or 913/914, thereby signaling the mismatchcondition. For example, if the comparand is high and the stored datavalue is low, then transistors 913 and 914 will be switched on to pullthe match line 827 low. Conversely, if the comparand is low and thestored data value is high, transistors 911 and 912 will be switched onto pull the match line 827 low. If the comparand and data value match,then neither transistor pair 911/912 nor 913/914 will be fully switchedon, thereby interrupting the path to the reference potential (so thatthe match line is not pulled low) to indicate the match condition. Itshould be noted that additional circuitry may be included within the CAMcell 801, including without limitation, timing control circuitryinterposed between the ground reference and source terminals oftransistors 912 and 914 of the compare circuit 910 to provide for timingcontrol over the comparison of the comparand value and stored datavalue. Further, although a specific compare circuit implementation hasbeen described in reference to FIG. 31, any other circuit that may beused to detect a match condition (or mismatch condition) may be used inalternative embodiments.

The validity CAM cell 802 of FIG. 27 maybe implemented in a mannersimilar to the CAM cell 801 shown in FIG. 31, except that a reset lineis provided to clear the value stored in storage element 901. Moregenerally, any storage cell capable of storing a validity bit andaffecting a logical state of the match line 827 according to the valueof the validity bit may be used to implement the validity CAM cell 802.Also, it should be noted that the error CAM array 800 described inreference to FIG. 27 (including the queue control circuit 807 andstorage CAM cell 801 described in reference to FIGS. 28 and 30) may beused to implement the error CAM 751 of FIG. 26. In such animplementation, neither the read bit lines (RBL and {overscore (RBL)})nor the read word line 823 need be connected to the storage CAM cells801. Also, the CAM cell 801 may have one or two signal ports, instead ofthe three signal ports (read, write, comparand) shown in FIG. 31.

Referring briefly to FIG. 27, it should be noted that, because separateread bit lines (RBL and {overscore (RBL)}), write bit lines (WBL and{overscore (WBL)}) and comparand lines (CL and {overscore (CL)}) areprovided, a comparand may be compared with error values stored withinthe error CAM array 800 concurrently with output of the error addressvalue via the read port (i.e., read bit lines RBL and {overscore(RBL)}), and concurrently with storage of a new error address valuewithin the error CAM array 800. Because the data value stored within agiven row of CAM cells may have an unknown logic state during a writeoperation, it may be desirable to provide circuitry to prevent matchindication by a row of CAM cells being loaded with an error addressvalue.

FIG. 32 illustrates a match disable transistor 933 that may be coupledto each match line 827 within the error CAM array 800 of FIG. 27 toprevent a match signal from being asserted on the match line while acorresponding row of CAM cells 932 is being loaded with an error addressvalue. A drain terminal of the match disable transistor 933 is coupledto the match line 827, a source terminal of the match disable transistor933 is coupled to a reference potential (ground in this example), and agate terminal of the match disable transistor 933 is coupled to thewrite word line 825 for the corresponding row of CAM cells 932. During aload operation directed to the row of CAM cells 932, the correspondingwrite word line 825 will be asserted, thereby switching on match disabletransistor 933 and pulling the match line 827 low. Thus, the matchdisable transistor 933 prevents a match indication for the row of CAMcells 932 during the load operation.

FIG. 33 illustrates an alternative CAM row structure for enablingsimultaneous write and compare operations within a CAM array whether theCAM array be an error CAM array having a dedicated read port, an errorCAM not having a dedicated read port, or any other CAM array. In FIG.33, each CAM cell 941 in a row of CAM cells 940 is coupled to a matchline 943 in the manner generally described in reference to FIG. 32.During a compare operation, bits of a comparand value are input tocorresponding CAM cells 941 via respective comparand lines forcomparison with contents of the CAM cells 941. Comparand lines 184 and185 of FIG. 2, and CL and {overscore (CL)} of FIG. 8 are examples ofcomparand lines that may be coupled to CAM cells 941 to providecomparand bits thereto. In one embodiment, each CAM cell 941 signals amismatch condition between the input comparand bit and a data bit storedin the CAM cell 941 by coupling the match line 943 to a ground referencevoltage. Thus, the match line 943 is pulled down to a logic low level toindicate a mismatch condition, and is pulled up (i.e., via a prechargeor pull-up circuit not shown) to a logic high level to indicate a matchcondition. In alternative embodiments, a mismatch may be signaled bypulling up an otherwise low match line 943.

During a write operation directed to the row 940, a write enable line944 is activated (e.g., to a logic high level) to enable a write datadriver (not shown in FIG. 33) to drive constituent bits of a data valueto be stored within row 940 onto respective bit lines coupled to CAMcells 941. Bit lines 186 and 187 of FIG. 2, and bit lines WBL and{overscore (WBL)} of FIG. 8 are examples of bit lines that may becoupled to CAM cells 941. While the data value is present on the bitlines, a word line 942 is asserted to enable each bit of the data valueto be captured (e.g., latched or registered) within a storage element ofa respective one of the CAM cells 941, thereby writing the data valueinto the row 940.

Because the contents of the CAM cells 941 maybe in transition during awrite operation, a compare operation performed concurrently with thewrite operation may yield a false match or false mismatch result. Thatis, comparison of a comparand value to the contents of row 940simultaneously or at least partly overlapping in time with activation ofword line 942 to enable data to be written into CAM cells 941, mayresult in a match (or mismatch) indication when in fact neither the datavalue being overwritten nor the data value being written match thecomparand value. Prior-art solutions to this problem have includedsuspending compare operations during write operations (athroughput-limiting solution), or dividing a timing cycle into separatecompare and write phases (e.g., waiting until the match result has beendetermined in a first phase of a timing cycle before activating a wordline to enable data write in a second phase of the timing cycle). Adisadvantage of the latter solution is that the timing cycle mustusually be long enough to permit both compare resolution (i.e., settlingof the match line state in the first phase of the timing cycle) and datawrite completion (settling of storage element state in the second phaseof the timing cycle); a difficult requirement to satisfy in the face ofever shrinking cycle times.

In embodiments of the present invention, true simultaneity between writeand compare operations is achieved by preventing match indication for arow of CAM cells being written to while leaving all other rows free tosignal match conditions. FIG. 32, described above, illustrates one suchembodiment that enables such simultaneous write and compare operation.Activation of write word line 825 (e.g., to a high logic level) switcheson transistor 933 (a switching circuit), thereby coupling match line 827to ground to force a mismatch indication while data is written to therow of CAM cells 932. In the embodiment of FIG. 33, a write enable line944 and word line 942 are coupled to a switching circuit implemented bylogic NAND gate 945 such that, when the write enable line and the wordline 942 are both high (i.e., during a write operation directed to therow of CAM cells 940), the output of NAND gate 945 goes low, therebypulling down match line 943 and preventing indication of a match by therow of CAM cells 940. Because the word line 942 is activated in responseto a write address value that decodes uniquely to word line 942, otherword lines coupled to other rows of CAM cells within the CAM arrayremain inactive (e.g., low) during a write operation directed to row940. Accordingly, when a compare operation is carried out simultaneouslywith the data write to row 940 (i.e., during activation of the word line942 and write enable line 944) match indications may be signaled for anyother rows of the CAM array.

FIG. 34 illustrates an alternative circuit arrangement for forcing amismatch indication during a write to CAM cells 941. Word line 942 iscoupled to CAM cells 941 and to an input of NAND gate 945 as describedin reference to FIG. 33. Write enable line 944 is coupled to the otherinput of NAND gate 945 so that the output of NAND gate 945 will go lowduring a write to CAM cells 941, also as described in reference to FIG.33. Instead of using the NAND gate output to pull down a match line,however, the NAND gate output is used to select, via a multiplexer 946,either a cell-coupled match line segment 943 _(A) or a reference voltage(ground in this example) to drive output match line segment 943 _(B).Cell-coupled match line segment 943A is coupled to the CAM cells 941 inthe same manner as match line segment 943 of FIG. 33 and may similarlybe pulled up (or down) to a reference voltage by a precharge or pull-up(or pull-down) circuit. Because the output of NAND gate 945 will go lowduring a write directed to CAM cells 941 (i.e., word line 942 and writeline 944 both activated), the ground reference voltage will be coupledto the output match line segment 943 _(B), thereby indicating a mismatchregardless of whether a comparand value matches the contents of the CAMcells 941. When the output of NAND gate 945 is high (no write operationin progress within CAM cells 941), multiplexer 946 will couplecell-coupled match line segment 943 _(A) to output match line segment943 _(B) so that match and mismatch conditions may be signaled accordingto whether the contents of the CAM cells 941 match a comparand value.

FIG. 35 illustrates yet another circuit arrangement for forcing amismatch indication during a write to CAM cells 941. In the embodimentof FIG. 35, word line 942, write enable line 944, NAND gate 945 andmatch line segments 943 operate generally as described in reference toFIG. 34, except that multiplexer 946 is replaced by AND gate 947. Thatis, cell-coupled match line segment 943 _(A) is coupled to a first inputof AND gate 947, the output of NAND gate 945 is coupled to the otherinput of AND gate 947, and the output of AND gate 947 is coupled to theoutput match line segment 943 _(B). Because the output of NAND gate 945will go low during a write directed to CAM cells 941, AND gate 947 will,in response, drive output match line segment 943 _(B) low, therebyindicating a mismatch regardless of whether a comparand value matchesthe contents of the CAM cells 941. When the output of NAND gate 945 ishigh, AND gate 947 will drive the output match line segment 943 _(B)according to the state of the cell-coupled match line segment 943 _(A).Accordingly, when no write operation is in progress within CAM cells941, match and mismatch conditions are signaled via output match linesegment 943 _(B) according to whether the contents of the CAM cells 941match a comparand value.

Reflecting on the operation of NAND gate 945 in FIG. 33, NAND gate 945and multiplexer 946 in FIG. 34, and NAND gate 945 and AND gate 947 inFIG. 35, it should be noted that any circuit (including a passive,wired-AND or wired-OR logic circuit) which prevents a match conditionfrom being signaled on a match line (including an output match linesegment) in response to activation of word line 942 and write enableline 944 may be used in alternative embodiments without departing fromthe spirit and scope of the present invention.

FIG. 36 illustrates an exemplary transistor circuit 950 that may be usedto implement NAND gate 945 of FIG. 33. Circuit 950 includes transistors948 and 949 coupled in series between a match line 943 and ground. Gateterminals of the transistors 949 and 948 are coupled respectively to awrite enable line 944 and a word line 942. Accordingly, when the wordline 942 and the write enable line 944 are both high (indicating a writeoperation directed to the corresponding row of CAM cells), transistors948 and 949 are switched on to couple match line 943 to ground andthereby prevent indication of a match condition. In an alternativeembodiment, a switching circuit similar to circuit 950 may be used tocouple the match line to a logic high voltage (e.g., V_(DD)) to force amismatch indication on a match line that is otherwise pulled down to alogic low voltage to signal a match. Also, other circuits may be used toimplement the NAND gate 945 of FIG. 33, including circuits based onbipolar (as opposed to field effect) technology.

FIG. 37 illustrates another alternative CAM row structure 951 forenabling simultaneous write and compare operations within a CAM array.CAM row structure 951 includes CAM cells 952 each coupled to a gateterminal of a respective pass-gate transistor 955. The pass gatetransistors 955 themselves are coupled in series with a plurality ofmatch line segments 953 ₁-953 _(N) such that, when all the pass gatetransistors 955 are switched on, a continuous signal path is formedbetween a first match line segment 953 ₁ and a final match line segment953 _(N). In the embodiment of FIG. 37, the first match line segment 953₁ is coupled to ground and the final match line segment 953 _(N), whichforms the match line output (i.e., coupled to a priority encoder and/ormatch logic), is pulled up to a logic high voltage via precharge circuit954. Each of the CAM cells 952.includes compare circuitry to output alogic high voltage to the gate terminal of the corresponding pass-gatetransistor 955 if, during a compare operation, the comparand value inputto the CAM cell 952 matches a data value stored in the CAM cell 952.Thus, if a comparand bit (or bits) matches a data value stored in theCAM cells 952 of row 951, each of the transistors 955 will be switchedon, thereby pulling the match line output (i.e., match line segment 953_(N)) low to signal the match condition. If any bit of the comparandvalue does not match the data value stored in the corresponding CAM cell952 (and is not masked, for example, by ternary operation of the CAMcell 952), the CAM cell 952 will not switch on the correspondingpass-gate transistor 955, effectively interrupting the path between thematch line output and ground-coupled match line segment 953 ₁. In thatevent, the match line output will remain pulled up to the logic highvoltage by the precharge circuit 954.

It should be noted that the circuit arrangements described in referenceto FIGS. 32-37 may be used in a CAM array in which multiple rows of CAMcells are updated in a single write operation. Referring to FIG. 33, forexample, multiple word lines 942 may be asserted at once to enable datato be written into corresponding rows of CAM cells. Due to the operationof NAND gates 945 (there being a respective NAND gate 945 for each rowof CAM cells in the CAM array), each of the match lines 943 coupled tothe rows being written would be forced to indicate a mismatch condition,thereby avoiding false match indication during the write operation. Inalternative embodiments, a group match-disable signal may be anadditional input to NAND gate 945 (or another logic circuit such as gate947 of FIG. 35) and used to force a mismatch signal for each row of agroup of rows.

Simultaneous write and compare operation is enabled within a CAM arrayhaving CAM cell rows according to FIG. 37 by coupling a switchingcircuit in series with a pair of match line segments 953 of each matchline. As shown in FIG. 37, for example, a switching circuit formed bytransistor 957 and logic NAND gate 956 is provided to selectivelyinterrupt the connection between the match line output (i.e., match linesegment 953 _(N)) and ground during a write operation directed to row951. More specifically, a write enable line 944 and word line 942 arecoupled to inputs of the NAND gate 956 so that, when both the writeenable line 944 and the word line 942 are high, the output of the logicNAND gate 956 goes low, thereby switching off transistor 957 andpreventing the match line output from being pulled low. Thus, during awrite operation directed to the row 951, the match line formed by matchline segments 953 is not pulled low to indicate a match condition,regardless of whether the contents of the row 951 matches a comparandvalue. Consequently, a compare operation within a CAM array thatincludes rows structured as shown in FIG. 37 may be carried outsimultaneously with a write operation directed to one of the rows. Therow to which a write operation is directed (i.e., corresponding wordline activated while write enable line is activated) is prevented fromindicating a match condition during the write operation, while otherrows of CAM cells within the CAM array remain free to indicate matches.

Still referring to FIG. 37, a number of alternative circuits andtechniques may be used to prevent assertion of a match indication on thematch line segment 953 _(N). For example, NAND gate 956 and transistor957 may be omitted in an alternative embodiment, and write line 944 andword line 942 may instead be used to enable a separate precharge circuit(or additional pull-up path within circuit 954) that overpowers the pulldown achieved by a connection between match line segments 953 _(N) and953 ₁. Also, the transistor 957 may be positioned elsewhere in the chainof match line segments 953 than the position shown in FIG. 37. Forexample, the transistor 957 may be coupled between match line segment953 ₁ and ground.

FIG. 38 illustrates a system 960 including a CAM device 961 having asimultaneous write and compare function as described above in referenceto embodiments 32-35. The system additionally includes a centralprocessing unit 962 (CPU) and a network processing unit 963 (NPU). Inone embodiment, the NPU 963 is used to control packet flow in a networkswitching or routing device, and issues compare instructions andcomparand values to the CAM device 961 via instruction bus 964 andcomparand bus 965, respectively. The NPU 963 may also issue other typesof instructions and data to the CAM device 961. The CAM device 961responds to compare instructions from the NPU 963 by driving thecorresponding comparand values onto comparand lines of a CAM array(i.e., within the CAM device 961) to carry out compare operations.Results of the compare operations, including match indications and matchaddresses are output via result bus 968 which may be coupled, forexample, to an associated memory that contains forwarding address valuesor other information associated with the comparand values that yieldedthe match addresses.

The CPU 962 is provided, at least in part, to perform system managementtasks that, if performed by the NPU 963, might interrupt the sequence ofNPU-directed compare operations (i.e., limit the throughput of compareoperations). For example, in one embodiment, the CPU 962 maintains anupdated table of search data by writing, via access path 967, updateddata values into selected storage rows within a CAM array of the CAMdevice 961. Because the CAM device 961 is capable of simultaneouslycarrying out write and compare operations, write instructions issued bythe CPU 962 may be executed simultaneously with compare instructionsissued by the NPU 963, thereby allowing the CAM array to be updatedwithout interrupting or otherwise delaying execution of the NPU-directedsequence of compare operations. Thus, a four-port architecture isenabled by the ability to simultaneously perform write and compareoperations within the CAM device 961, the four ports including thecomparand bus 965, instruction bus 964, result bus 968 and access path967. In an alternative embodiment, one or more of the ports may beomitted from the CAM device 961, with the signals otherwise provided to(or output from) the CAM device 961 via the omitted port being input to(or output from) the CAM device 961 through one or more of the remainingports (e.g., by time-multiplexing use of a remaining port). Also, theresult bus 968 may additionally be coupled to provide result information(and/or status information) to the CPU 962 and/or NPU 963 as indicatedby dashed line 966.

Because of the simultaneous write and compare capability of the CAMdevice 961, no handshaking or other special communication protocol isrequired for the CPU 962 to instruct the CAM device 961 to execute awrite operation (i.e., in determining when to issue a write instruction,the CPU 962 need not account for compare activity within the CAM device961). Accordingly, in one embodiment, the CAM device 961 includes aninterface designed to present a standard, SRAM (static random accessmemory) interface to the CPU 962. Referring to FIG. 39 for example, anembodiment of the CAM device 961 includes an access path interface 970to receive data and SRAM-type access control signals from the CPU 962.The access path interface 970 includes a data interface (DATA) toreceive a data value formed by one or more parallel bit transfers; anaddress path (ADDR) to receive an address that will be resolved to aselected row of CAM cells within the CAM device 961; a chip enableinterface (CE) to receive one or more chip enable signals (e.g., used toresolve between the CAM device 961 and other devices that may beaccessed by the CPU 962, including other CAM devices); a read/writeinterface (R/{overscore (W)}) to receive a signal that indicates whethera requested access operation is a read or write operation; and,optionally, a clock interface (CLK) to receive a clock signal for timingthe requested access operation. By this arrangement, the CAM device 961may be used with a broad range of commercially available CPUs thatinclude interface logic and pin-outs necessary to interface withstandard SRAM devices.

FIG. 40 illustrates the use of a delay circuit 931 to synchronize theoutput of a match index 933 and a match error signal 732. The priorityencoder 114 outputs a match index 174 to the error CAM 715 and to thedelay circuit 931. The match index 174 is designated “INDEX-I” in FIG.40 to indicate that it is an intermediate index signal. The error CAM715 performs the comparison operation described above to determine ifthe match index 174 matches any error address values stored within theerror CAM array and outputs a match error signal 732 accordingly. Thedelay circuit 931 delays the output of the match index 933 (designated“INDEX-D” in FIG. 40 to indicate that the match index 933 is a delayedversion of the match index 174) such that the match index 933 and thematch error 732 are output concurrently (i.e., at least partlyoverlapping in time). In one embodiment, the delay circuit 931 isimplemented by one or more delay elements coupled in series to delay thematch index 174 by a predetermined time that corresponds to the timerequired for the error CAM 715 to generate the match error signal 732.In an alternative embodiment, the delay circuit 931 may be implementedby a register or other edge-triggered circuit that outputs the matchindex 933 in response to an output control signal (shown by dashed line789), supplied, for example by an instruction decoder (e.g., element 105of FIG. 24) or other circuit within the CAM device. The output controlsignal 789 may also be coupled to a register or other edge-triggeredcircuit within the error CAM 715 to time the output of the match errorsignal 732. By this arrangement the match index 933 and the match errorsignal 732 may be output in response to the same control signal and,therefore, at substantially the same time. Although error CAM 715 isdepicted in FIG. 40, the delay circuit 931 may also be used tosynchronize the match index signal 933 with the match index signal 732output by the error CAM 751 of FIG. 25.

FIG. 41 is a timing diagram that illustrates the pipelining of data anderror compare operations within a CAM device, and the relative outputtimes of an intermediate match index, delayed match index and matcherror signals (i.e., signals 174, 933 and 732, respectively, describedin reference to FIG. 40). During a first timing cycle, cycles (which maybe defined, for example, by one or more cycles of a clock signal, or apredetermined time interval), a corresponding data compare operation,data compare_(i), is performed. During the subsequent timing cycle,cycle_(i+1), the intermediate index signal, INDEX-I_(i), resulting fromdata compare_(i) is output and the corresponding error compareoperation, error compare_(i) is performed. Data compare_(i+1) is alsoperformed during cycle_(i+1). During cycle_(i+2), the delayed indexsignal, INDEX-D_(i), resulting from data compare_(i) is output, as isthe corresponding match error signal, ME_(i). Also during cycle_(i+2),data compare_(i+2) is performed, intermediate index signal INDEX-I_(i+1)is output and error compare_(i+1) is performed. Similarly, duringcycle_(i+3), the delayed index signal INDEX-D_(i+1), resulting from datacompare_(i+1) is output along with the corresponding match error signal,ME_(i+1), data compare_(i+3) is performed, intermediate index signalINDEX-I_(i+2) is output, and error compare_(i+2) is performed. Thus, itcan be seen that by pipelining the data compare and error compareoperations, an updated match index (INDEX-D) and corresponding errorsignal may be output during each new timing cycle, despite theadditional time required to perform the error compare operation.Accordingly, the overall throughput of the CAM device is not reduced.

Although the invention has been described with reference to specificexemplary embodiments thereof, it will be evident that variousmodifications and changes may be made thereto without departing from thebroader spirit and scope of the invention as set forth in the appendedclaims. The specification and drawings are, accordingly, to be regardedin an illustrative rather than a restrictive sense.

What is claimed is:
 1. A content addressable memory (CAM) devicecomprising: a plurality of rows of CAM cells; match lines coupled to theplurality of rows of CAM cells; word lines coupled to the plurality ofrows of CAM cells; and a plurality of switching circuits coupled to theword lines and the match lines, each switching circuit being adapted toselectively disable assertion of a match signal on a corresponding oneof the match lines based, at least in part, on a state of acorresponding one of the word lines.
 2. The CAM device of claim 1wherein each of the switching circuits comprises a first transistorcoupled between the corresponding one of the match lines and a referencevoltage, the first transistor having a control terminal coupled to thecorresponding one of the word lines.
 3. The CAM device of claim 2wherein the reference voltage is a ground reference voltage.
 4. The CAMdevice of claim 2 wherein the first transistor is adapted to couple thecorresponding one of the match lines to the reference voltage when thecorresponding one of the word lines is in a first state.
 5. The CAMdevice of claim 1 wherein each of the switching circuits furthercomprises a first transistor and a second transistor coupled in seriesbetween the corresponding one of the match lines and a referencevoltage, the first transistor having a control terminal coupled to thecorresponding one of the word lines and a second transistor having acontrol terminal coupled to receive a write enable signal.
 6. The CAMdevice of claim 1 wherein the first transistor is switched on inresponse to a first state of the corresponding one of the word lines andthe second transistor is switched on in response to assertion of thewrite enable signal, the first and second transistors operating toswitchably couple the corresponding one of the match lines to thereference voltage.
 7. The CAM device of claim 6 wherein the referencevoltage is a ground reference voltage.
 8. The CAM device of claim 1further comprising a write signal line coupled to each of the pluralityof switching circuits, each switching circuit being adapted toselectively disable assertion of the match signal on the one of thematch lines based, in part, on a state of the write signal line.
 9. TheCAM device of claim 1 further comprising a control circuit to drive aselected one of the word lines to a first state in response to anaddress that corresponds to the selected one of the word lines and inresponse to a write enable signal, a corresponding one of the switchingcircuits being adapted to disable assertion of the match signal on thecorresponding one of the match lines in response to the first state ofthe selected one of the word lines.
 10. The CAM device of claim 1wherein the switching circuit is a logic circuit having a first inputcoupled to the corresponding one of the word lines, a second inputcoupled to a write enable line, and an output coupled to thecorresponding one of the match lines.
 11. The CAM device of claim 10wherein the logic circuit is adapted to drive the match signal line to astate that indicates a mismatch condition in response to thecorresponding one of the word lines and the write enable line havingrespective states that enable a write operation in one of the pluralityof rows of CAM cells to which the corresponding one of the word lines iscoupled.
 12. The CAM device of claim 10 wherein a write operation in theone of the plurality of rows of CAM cells is enabled when thecorresponding one of the word lines and the write enable line are eachin a high logic state.
 13. The CAM device of claim 1 wherein each of thematch lines comprises a plurality of match line segments, each matchline segment being coupled to at least one other of the match linessegments via a respective CAM cell of a corresponding one of the rows ofCAM cells.
 14. The CAM device of claim 13 wherein a first one of thematch line segments is coupled between a reference voltage and a firstCAM cell of the corresponding one of the rows of CAM cells, and a finalone of the match lines segments is coupled to a final CAM cell of thecorresponding one of the rows, the CAM cells of the corresponding one ofthe rows of CAM cells being adapted to switchably couple all the matchline segments to form a match signal path between the first one of thematch line segments and the final one of the match line segments. 15.The CAM device of claim 14 wherein each of the CAM cells is adapted toswitchably couple all the match line segments to form the match signalpath in response to a match condition between unmasked contents of theCAM cells and a comparand value.
 16. The CAM device of claim 15 whereinthe switching circuit is coupled in series with the match signal path tointerrupt the match signal path if the corresponding one of the wordlines and a write enable line have respective states that enable a writeoperation in one of the plurality of rows of CAM cells to which thecorresponding one of the word lines is coupled.
 17. The CAM device ofclaim 1 wherein each of the match lines comprises: a cell-coupled matchline segment coupled to a respective one of the rows of CAM cells; andan output match line segment, and wherein each switching circuit isadapted to selectively disable assertion of a match signal on acorresponding output match line segment by selectively disabling a stateof the cell-coupled match line segment from affecting the output matchline segment.
 18. The CAM device of claim 17 wherein each switchingcircuit comprises a multiplexer having a first input coupled to thecell-coupled match line segment, a second input coupled to a referencevoltage, and an output coupled to the output match line segment.
 19. TheCAM device of claim 18 wherein the multiplexer is adapted to coupleeither the cell-coupled match line segment or the reference voltage tothe output match line segment based, at least in part, on the state ofthe corresponding one of the word lines.
 20. The CAM device of claim 17,wherein each switching circuit comprises a logic circuit having a firstinput coupled to the cell-coupled match line segment, a second inputcoupled to receive a control signal, and an output coupled to the outputmatch line segment, the logic circuit being adapted to drive the outputmatch line segment according to a state of the cell-coupled match linesegment if the control signal is in a first state, and the logic circuitbeing adapted to drive the output match line segment to a state thatindicates a mismatch condition if the control signal is in a secondstate.
 21. The CAM device of claim 20 wherein the control signal is ineither the first state or the second state based, at least in part, onthe state of the corresponding one of the word lines.
 22. A method ofoperation within a content addressable memory device, the methodcomprising: comparing a comparand value to data values stored withinrespective rows of CAM cells; and simultaneously activating a word linethat corresponds to a selected row of the rows of CAM cells to enable adata write operation within the selected row.
 23. The method of claim 22further comprising: outputting, for each of the rows of CAM cells exceptthe selected row, a signal that indicates whether the data value storedwithin the row of CAM cells matches the comparand value; and outputtinga signal that indicates a mismatch between contents of the selected rowand the comparand value, regardless of whether the contents of theselected row match the comparand value.
 24. The method of claim 23wherein outputting a signal that indicates a mismatch between contentsof the selected row and the comparand value comprises switchablycoupling a match line to a first reference voltage, the match linecorresponding to the selected row.
 25. The method of claim 24 whereinswitchably coupling the match line to the first reference voltagecomprises switchably coupling the match line to ground.
 26. The methodof claim 24 wherein switchably coupling the match line to the firstreference voltage comprises coupling the match line to the firstreference voltage in response to the word line being activated.
 27. Themethod of claim 26 wherein activating the word line comprises receivingan address value that corresponds to the selected row and detectingassertion of a write enable signal.
 28. The method of claim 24 furthercomprising activating a write enable line to enable the data writeoperation, and wherein switchably coupling the match line to the firstreference voltage comprises coupling the match line to the firstreference voltage in response to the word line and the write enable lineboth being activated.
 29. The method of claim 23 wherein outputting asignal that indicates a mismatch comprises switchably decoupling a matchline from a first reference voltage, the match line corresponding to theselected row.
 30. The method of claim 23 wherein switchably decouplingthe match line from the first reference voltage comprises activating atransistor switch coupled in series between the match line and thereference voltage.
 31. A content addressable memory (CAM) devicecomprising: a plurality of rows of CAM cells; means for comparing acomparand value to data values stored within the rows of CAM cells; andmeans for activating a word line that corresponds to a selected row ofthe rows of CAM cells to enable a data write operation within theselected row, wherein the means for activating the word line is adaptedto activate the word line simultaneously with comparing the comparandvalue to data values stored within the rows of CAM cells.
 32. The CAMdevice of claim 31 further comprising: means for outputting, for each ofthe rows of CAM cells except the selected row, a signal that indicateswhether the data value stored within the row of CAM cells matches thecomparand value; and means for outputting a signal that indicates amismatch between contents of the selected row and the comparand value,regardless of whether the contents of the selected row match thecomparand value.
 33. The CAM device of claim 32 wherein the means foroutputting a signal that indicates a mismatch between contents of theselected row and the comparand value comprises means for switchablycoupling a match line to a first reference voltage, the match linecorresponding to the selected row.
 34. The CAM device of claim 33wherein the means for switchably coupling the match line to the firstreference voltage comprises means for coupling the match line to thefirst reference voltage in response to the word line being activated bythe means for activating a word line.
 35. The CAM device of claim 32wherein the means for outputting a signal that indicates a mismatchcomprises means for switchably decoupling a match line from a firstreference voltage, the match line corresponding to the selected row. 36.The CAM device of claim 35 wherein the means for switchably decouplingthe match line from the first reference voltage comprises means foractivating a transistor switch coupled in series between the match lineand the reference voltage.